Re: White screen

2015-06-13 Thread Md Bayezid Alam
Check first the requirement is configured on ubuntu
http://book.cakephp.org/3.0/en/installation.html#requirements . specially intl
extension and mbstring extension

On Sat, Jun 13, 2015 at 10:01 AM, joelro  wrote:

> I am running an Ubuntu 14.04 server and only get a white screen when I go
> to my sites address.  I assume it is a configuration probel, but I'm
> stuck.  Any suggestions for fixing this cakephp 3.0 install?
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: How to set Authorization wise view in the Form in CakePHP-3.0

2015-05-28 Thread Md Bayezid Alam
Thanks a lot. its working now. Is there any other easiest way to do so?

On Thu, May 28, 2015 at 8:50 PM, euromark  wrote:

> check() and comparison is really a bad idea
> the first returns bool, how should that ever === to a string?
> wrapping that with !empty() makes this completely wrong
>
> if(!empty($this->request->session()->check('Auth.User.role') === 
> 'superadmin')){
>
>
>
> Try
>
> if ($this->request->session()->read('Auth.User.role') === 'superadmin') {}
>
> instead
>
>
> Am Donnerstag, 28. Mai 2015 15:54:47 UTC+2 schrieb Bayezid Alam:
>>
>> Hi All,
>>
>> I want to set an authorization in the registration of a form using
>> CakePHP 3.0.
>>
>> Before asking here, i tried below things but no luck in my favor.
>>
>> Suppose i have role field in the usersTable like 'superuser', 'admin',
>> 'user'.
>>
>> I want to provide permission superuser to make all the things like create
>> admin and user. and then admin can create admin and user, and user can make
>> user only.
>>
>> The code i tried in the add function of UsersController.
>>
>> if($this->Auth->user['role'] === 'superuser'){
>> $roles = $this->Users->find('list');
>> } elseif ($this->Auth->user['role'] === 'admin') {
>> $roles = $this->Users->find('list')->where(['Users.role !==' => 
>> 'superuser']);
>> } else {
>> $roles = $this->Users->find('list')->where(['Users.role' => 'user']);
>> }
>>
>> after failing i tried below things in the add.ctp
>>
>> if(!empty($this->request->session()->check('Auth.User.role') === 
>> 'superadmin')){
>> echo $this->Form->input('role',['options' => ['admin' => 
>> 'Admin', 'user' => 'User']]);
>> } elseif(!empty($this->request->session()->check('Auth.User.role') 
>> === 'admin')){
>> echo $this->Form->input('role',['options' => ['user' => 'User', 
>> 'icr' => 'ICR', 'routing' => 'Routing']]);
>> } else {
>> echo $this->Form->input('role', ['options' => ['user' => 
>> 'User']]);
>> }
>>
>> Could you please suggest on this regard or are there any easiest ways to
>> do so?
>>
>>
>> http://stackoverflow.com/questions/30487160/how-to-set-authorization-wise-view-in-the-form-in-cakephp-3-0
>>
>> Thanks
>>
>> Bayezid
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


How to set Authorization wise view in the Form in CakePHP-3.0

2015-05-28 Thread Md Bayezid Alam
Hi All,

I want to set an authorization in the registration of a form using CakePHP
3.0.

Before asking here, i tried below things but no luck in my favor.

Suppose i have role field in the usersTable like 'superuser', 'admin',
'user'.

I want to provide permission superuser to make all the things like create
admin and user. and then admin can create admin and user, and user can make
user only.

The code i tried in the add function of UsersController.

if($this->Auth->user['role'] === 'superuser'){
$roles = $this->Users->find('list');
} elseif ($this->Auth->user['role'] === 'admin') {
$roles = $this->Users->find('list')->where(['Users.role !=='
=> 'superuser']);
} else {
$roles = $this->Users->find('list')->where(['Users.role' => 'user']);
}

after failing i tried below things in the add.ctp

if(!empty($this->request->session()->check('Auth.User.role') === 'superadmin')){
echo $this->Form->input('role',['options' => ['admin' =>
'Admin', 'user' => 'User']]);
} elseif(!empty($this->request->session()->check('Auth.User.role')
=== 'admin')){
echo $this->Form->input('role',['options' => ['user' =>
'User', 'icr' => 'ICR', 'routing' => 'Routing']]);
} else {
echo $this->Form->input('role', ['options' => ['user' => 'User']]);
}

Could you please suggest on this regard or are there any easiest ways to do
so?

http://stackoverflow.com/questions/30487160/how-to-set-authorization-wise-view-in-the-form-in-cakephp-3-0

Thanks

Bayezid

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Cakephp 3.0

2015-05-16 Thread Md Bayezid Alam
Hi,

You can load Model by using $this->loadModel('YourTablenames');

Thanks

On Sat, May 16, 2015 at 12:35 PM, Karthik Keyan  wrote:

> Hi
> How to use multiple tables in  single controller in *cakephp 3.0 *
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.0 - Confusion comes from

2015-04-16 Thread Md Bayezid Alam
As this process has been deprecated during the RC, so hoping soon to update
the docs otherwise it will make a huge confusions among the readers. :)

On Thu, Apr 2, 2015 at 7:31 PM, Dave Edwards  wrote:

> Hi  Farid,
>
> I'm not decrying the value or usefulness of the documentation, or the huge
> amount of work that has gone into creating it.
>
> As this is new functionality (ORM), it needs to be put right asap,
> particularly as there will be few examples of this anywhere else to refer
> to. I could go in fix it myself, the only problem is I don't know the
> correct answer because the manual is not clear :)
>
>
> On Thursday, 2 April 2015 05:46:52 UTC+1, Farid Aditya wrote:
>>
>> Hi dave
>> I agree with you, but I also disagree
>> cakephp manual book may not be perfect, but it is quite complete and very
>> helpful to understand the cakephp. deficiencies in the manual may be
>> updated in the next update. And that is not in the manual book, we can ask
>> each other in this group.
>>
>> On Friday, March 27, 2015 at 9:37:26 PM UTC+7, Bayezid Alam wrote:
>>
>> Hi,
>>
>> A confusion comes on my mind regarding the adding something on CakePHP 3.0
>>
>> As example given on below link's in the add function.
>> http://book.cakephp.org/3.0/en/tutorials-and-examples/
>> blog/part-two.html#adding-articles
>>
>> public function add()
>> {
>> $article = $this->Articles->newEntity(); // *A blank newEnttity 
>> added stored in $article variable*
>> if ($this->request->is('post')) {
>> $article = $this->Articles->patchEntity($article, 
>> $this->request->data); // *A patchEntity added here & passed the request 
>> data here*
>> if ($this->Articles->save($article)) {
>> $this->Flash->success(__('Your article has been saved.'));
>> return $this->redirect(['action' => 'index']);
>> }
>> $this->Flash->error(__('Unable to add your article.'));
>> }
>> $this->set('article', $article);
>> }
>>
>>
>>
>> But i found a different things on below link
>> http://book.cakephp.org/3.0/en/tutorials-and-examples/
>> blog-auth-example/auth.html#creating-all-user-related-code
>>
>> public function add()
>> {
>> $user = $this->Users->newEntity($this->request->data); // *request 
>> data passing through newEntity here*
>> if ($this->request->is('post')) {
>> if ($this->Users->save($user)) {
>> $this->Flash->success(__('The user has been saved.'));
>> return $this->redirect(['action' => 'add']);
>> }
>> $this->
>>
>> ...
>>
>> ...
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cakephp 3.0 - which approach is best to get instance of a Table using loadModel or TableRegistry

2015-04-11 Thread Md Bayezid Alam
Thanks a lot [?]

On Sun, Apr 12, 2015 at 2:00 AM, José Lorenzo  wrote:

> Answered in stackoverflow
>
>
> On Saturday, April 11, 2015 at 8:00:02 PM UTC+2, Bayezid Alam wrote:
>>
>> Hi,
>>
>> A question arises on me is that which approach is the best from the
>> performance sense to get an instance of a table in CakePHP-3.0 which is not
>> a controller's default one between loadModel or TableRegistry.
>>
>> 1. $this->loadModel('Articles');
>> OR2. TableRegistry::get('Articles');
>>
>>
>> Already asked on stackoverflow. http://stackoverflow.com/
>> questions/29578825/which-approach-is-best-to-get-
>> instance-of-a-table-using-loadmodel-or-tableregist
>>
>>
>> Thanks
>>
>> Bayezid
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


cakephp 3.0 - which approach is best to get instance of a Table using loadModel or TableRegistry

2015-04-11 Thread Md Bayezid Alam
Hi,

A question arises on me is that which approach is the best from the
performance sense to get an instance of a table in CakePHP-3.0 which is not
a controller's default one between loadModel or TableRegistry.

1. $this->loadModel('Articles');
OR2. TableRegistry::get('Articles');


Already asked on stackoverflow.
http://stackoverflow.com/questions/29578825/which-approach-is-best-to-get-instance-of-a-table-using-loadmodel-or-tableregist


Thanks

Bayezid

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.0 - Confusion comes from

2015-03-31 Thread Md Bayezid Alam
Got it [?] Thanks

On Tue, Mar 31, 2015 at 6:49 PM, Farid Aditya 
wrote:

> no cookbook tutorial/example is fine
> maybe
> $this->Model->newEntity(); is to create  new object with blank attribute
> or create blank object container
> $this->Model->patchEntity($oldObjectAttr , $newObjAttr); is to update
> object attribute
>
> On Friday, March 27, 2015 at 9:37:26 PM UTC+7, Bayezid Alam wrote:
>>
>> Hi,
>>
>> A confusion comes on my mind regarding the adding something on CakePHP 3.0
>>
>> As example given on below link's in the add function.
>> http://book.cakephp.org/3.0/en/tutorials-and-examples/
>> blog/part-two.html#adding-articles
>>
>> public function add()
>> {
>> $article = $this->Articles->newEntity(); // *A blank newEnttity 
>> added stored in $article variable*
>> if ($this->request->is('post')) {
>> $article = $this->Articles->patchEntity($article, 
>> $this->request->data); // *A patchEntity added here & passed the request 
>> data here*
>> if ($this->Articles->save($article)) {
>> $this->Flash->success(__('Your article has been saved.'));
>> return $this->redirect(['action' => 'index']);
>> }
>> $this->Flash->error(__('Unable to add your article.'));
>> }
>> $this->set('article', $article);
>> }
>>
>>
>>
>> But i found a different things on below link
>> http://book.cakephp.org/3.0/en/tutorials-and-examples/
>> blog-auth-example/auth.html#creating-all-user-related-code
>>
>> public function add()
>> {
>> $user = $this->Users->newEntity($this->request->data); // *request 
>> data passing through newEntity here*
>> if ($this->request->is('post')) {
>> if ($this->Users->save($user)) {
>> $this->Flash->success(__('The user has been saved.'));
>> return $this->redirect(['action' => 'add']);
>> }
>> $this->
>>
>> ...
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.0 - Confusion comes from

2015-03-30 Thread Md Bayezid Alam
Good point.. [?]

On Tue, Mar 31, 2015 at 2:28 AM, Dave Edwards 
wrote:

> Thanks for the reply.
>
> In that case not only is the blog tutorial wrong, but the manual is
> misleading as well.
>
> In http://book.cakephp.org/3.0/en/orm/saving-data.html patchEntity is not
> introduced until the section 'Merging Request Data Into Entities' at which
> point it has moved on from explaining how to save data to updating it.
>
> Dave
>
>
> On Monday, 30 March 2015 09:16:50 UTC+1, euromark wrote:
>>
>> no, patchEntity is what it is: it patches data into the entity
>> that is necessary for ALL forms, so both add and edit ones of course.
>>
>>
>> Am Sonntag, 29. März 2015 21:15:28 UTC+2 schrieb Dave Edwards:
>>>
>>> Why has the first method (which is the correct one) got both
>>>
>>> $this->Articles->newEntity()
>>>
>>> and
>>>
>>>  $this->Articles->patchEntity()
>>>
>>> when you are saving a new record?
>>>
>>> I thought that newEntity was used when inserting new data, and
>>> patchEntity was for updating existing data? Is my understanding incorrect?
>>>
>>> Dave
>>>
>>> On Friday, 27 March 2015 21:24:38 UTC, euromark wrote:
>>>
>>> The latter is deprecated, this changed during RC and as such the
>>> tutorial needs some updating.
>>> Thats all there is to it :)
>>>
>>> Mark
>>>
>>>
>>> Am Freitag, 27. März 2015 15:37:26 UTC+1 schrieb Bayezid Alam:
>>>
>>> Hi,
>>>
>>> A confusion comes on my mind regarding the adding something on CakePHP
>>> 3.0
>>>
>>> As example given on below link's in the add function.
>>> http://book.cakephp.org/3.0/en/tutorials-and-examples/
>>> blog/part-two.html#adding-articles
>>>
>>> public function add()
>>> {
>>> $article = $this->Articles->newEntity(); // *A blank newEnttity 
>>> added stored in $article variable*
>>> if ($this->request->is('post')) {
>>> $article = $this->Articles->patchEntity($article, 
>>> $this->request->data); // *A patchEntity added here & passed the request 
>>> data here*
>>> if ($this->Articles->save($article)) {
>>> $this->Flash->success(__('Your article has been saved.'));
>>> return $this->redirect(['action' => 'index']);
>>> }
>>> $this->Flash->error(__('Unable to add your article.'));
>>> }
>>> $this->set('article', $article);
>>> }
>>>
>>>
>>>
>>> But i found a different things on below link
>>> http://book.cakephp.org/3.0/en/tutorials-and-examples/
>>> blog-auth-example/auth.html#creating-all-user-related-code
>>>
>>> public function add()
>>> {
>>> $user = $this->Users->newEntity($this->request->data); // *request 
>>> data passing through newEntity here*
>>> if ($this->request->is('post')) {
>>> if ($this->Users->save($user)) {
>>> $this->Flash->success(__('The user has been saved.'
>>>
>>> ...
>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.0 - Confusion comes from

2015-03-29 Thread Md Bayezid Alam
That was my understanding too.

On Mon, Mar 30, 2015 at 1:15 AM, Dave Edwards 
wrote:

> Why has the first method (which is the correct one) got both
>
> $this->Articles->newEntity()
>
> and
>
>  $this->Articles->patchEntity()
>
> when you are saving a new record?
>
> I thought that newEntity was used when inserting new data, and patchEntity
> was for updating existing data? Is my understanding incorrect?
>
> Dave
>
> On Friday, 27 March 2015 21:24:38 UTC, euromark wrote:
>>
>> The latter is deprecated, this changed during RC and as such the tutorial
>> needs some updating.
>> Thats all there is to it :)
>>
>> Mark
>>
>>
>> Am Freitag, 27. März 2015 15:37:26 UTC+1 schrieb Bayezid Alam:
>>>
>>> Hi,
>>>
>>> A confusion comes on my mind regarding the adding something on CakePHP
>>> 3.0
>>>
>>> As example given on below link's in the add function.
>>> http://book.cakephp.org/3.0/en/tutorials-and-examples/
>>> blog/part-two.html#adding-articles
>>>
>>> public function add()
>>> {
>>> $article = $this->Articles->newEntity(); // *A blank newEnttity 
>>> added stored in $article variable*
>>> if ($this->request->is('post')) {
>>> $article = $this->Articles->patchEntity($article, 
>>> $this->request->data); // *A patchEntity added here & passed the request 
>>> data here*
>>> if ($this->Articles->save($article)) {
>>> $this->Flash->success(__('Your article has been saved.'));
>>> return $this->redirect(['action' => 'index']);
>>> }
>>> $this->Flash->error(__('Unable to add your article.'));
>>> }
>>> $this->set('article', $article);
>>> }
>>>
>>>
>>>
>>> But i found a different things on below link
>>> http://book.cakephp.org/3.0/en/tutorials-and-examples/
>>> blog-auth-example/auth.html#creating-all-user-related-code
>>>
>>> public function add()
>>> {
>>> $user = $this->Users->newEntity($this->request->data); // *request 
>>> data passing through newEntity here*
>>> if ($this->request->is('post')) {
>>> if ($this->Users->save($user)) {
>>> $this->Flash->success(__('The user has been saved.'));
>>> return $this->redirect(['action' => 'add']);
>>> }
>>> $this->
>>>
>>> ...
>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.0 - Confusion comes from

2015-03-28 Thread Md Bayezid Alam
PR created by  #2560

On Sat, Mar 28, 2015 at 6:43 PM, euromark  wrote:

> It would be cool if you could PR the corrections so that others don't trip
> over it, too.
>
> mark
>
>
> Am Samstag, 28. März 2015 10:35:52 UTC+1 schrieb Bayezid Alam:
>>
>> Ok, Thanks for reply.. :)
>>
>> On Sat, Mar 28, 2015 at 3:24 AM, euromark  wrote:
>>
>> The latter is deprecated, this changed during RC and as such the tutorial
>> needs some updating.
>> Thats all there is to it :)
>>
>> Mark
>>
>>
>> Am Freitag, 27. März 2015 15:37:26 UTC+1 schrieb Bayezid Alam:
>>
>> Hi,
>>
>> A confusion comes on my mind regarding the adding something on CakePHP 3.0
>>
>> As example given on below link's in the add function.
>> http://book.cakephp.org/3.0/en/tutorials-and-examples/blog/
>> part-two.html#adding-articles
>>
>> public function add()
>> {
>> $article = $this->Articles->newEntity(); // *A blank newEnttity 
>> added stored in $article variable*
>> if ($this->request->is('post')) {
>> $article = $this->Articles->patchEntity($article, 
>> $this->request->data); // *A patchEntity added here & passed the request 
>> data here*
>> if ($this->Articles->save($article)) {
>> $this->Flash->success(__('Your article has been saved.'));
>> return $this->redirect(['action' => 'index']);
>> }
>> $this->Flash->error(__('Unable to add your article.'));
>> }
>> $this->set('article', $article);
>> }
>>
>>
>>
>> But i found a different things on below link
>> http://book.cakephp.org/3.0/en/tutorials-and-examples/blog-
>> auth-example/auth.html#creating-all-user-related-code
>>
>> public function add()
>> {
>> $user = $this->Users->newEntity($this->request->data); // *request 
>> data passing through newEntity here*
>> if ($this->request->is('post')) {
>> if ($this->Users->save($user)) {
>> $this->Flash->success(__('The user has been saved.'));
>> return $this->redirect(['action' => 'add']);
>> }
>> $this->
>>
>> ...
>>
>>  --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to cake-php+u...@googlegroups.com.
>> To post to this group,
>>
>> ...
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.0 - Confusion comes from

2015-03-28 Thread Md Bayezid Alam
Ok, Thanks for reply.. :)

On Sat, Mar 28, 2015 at 3:24 AM, euromark  wrote:

> The latter is deprecated, this changed during RC and as such the tutorial
> needs some updating.
> Thats all there is to it :)
>
> Mark
>
>
> Am Freitag, 27. März 2015 15:37:26 UTC+1 schrieb Bayezid Alam:
>>
>> Hi,
>>
>> A confusion comes on my mind regarding the adding something on CakePHP 3.0
>>
>> As example given on below link's in the add function.
>> http://book.cakephp.org/3.0/en/tutorials-and-examples/
>> blog/part-two.html#adding-articles
>>
>> public function add()
>> {
>> $article = $this->Articles->newEntity(); // *A blank newEnttity 
>> added stored in $article variable*
>> if ($this->request->is('post')) {
>> $article = $this->Articles->patchEntity($article, 
>> $this->request->data); // *A patchEntity added here & passed the request 
>> data here*
>> if ($this->Articles->save($article)) {
>> $this->Flash->success(__('Your article has been saved.'));
>> return $this->redirect(['action' => 'index']);
>> }
>> $this->Flash->error(__('Unable to add your article.'));
>> }
>> $this->set('article', $article);
>> }
>>
>>
>>
>> But i found a different things on below link
>> http://book.cakephp.org/3.0/en/tutorials-and-examples/
>> blog-auth-example/auth.html#creating-all-user-related-code
>>
>> public function add()
>> {
>> $user = $this->Users->newEntity($this->request->data); // *request 
>> data passing through newEntity here*
>> if ($this->request->is('post')) {
>> if ($this->Users->save($user)) {
>> $this->Flash->success(__('The user has been saved.'));
>> return $this->redirect(['action' => 'add']);
>> }
>> $this->
>>
>> ...
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


CakePHP 3.0 - Confusion comes from

2015-03-27 Thread Md Bayezid Alam
Hi,

A confusion comes on my mind regarding the adding something on CakePHP 3.0

As example given on below link's in the add function.
http://book.cakephp.org/3.0/en/tutorials-and-examples/blog/part-two.html#adding-articles

public function add()
{
$article = $this->Articles->newEntity(); // *A blank
newEnttity added stored in $article variable*
if ($this->request->is('post')) {
$article = $this->Articles->patchEntity($article,
$this->request->data); // *A patchEntity added here & passed the
request data here*
if ($this->Articles->save($article)) {
$this->Flash->success(__('Your article has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('Unable to add your article.'));
}
$this->set('article', $article);
}



But i found a different things on below link
http://book.cakephp.org/3.0/en/tutorials-and-examples/blog-auth-example/auth.html#creating-all-user-related-code

public function add()
{
$user = $this->Users->newEntity($this->request->data); //
*request data passing through newEntity here*
if ($this->request->is('post')) {
if ($this->Users->save($user)) {
$this->Flash->success(__('The user has been saved.'));
return $this->redirect(['action' => 'add']);
}
$this->Flash->error(__('Unable to add the user.'));
}
$this->set('user', $user);
}


Could you please help explaining the differences between?  Which approach
should we use if we can apply both?

*I knew we should use patchEntity while editing anything and newEntity for
adding, right?*

Thanks
Bayezid

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Cake3 - Blog Tutorial Part 3 error founds

2015-03-27 Thread Md Bayezid Alam
Ohh, Thanks, But there was not any info to create the table first.



On Fri, Mar 27, 2015 at 2:01 PM, José Lorenzo  wrote:

> You need to create the categories table first.
>
>
> On Friday, March 27, 2015 at 5:34:46 AM UTC+1, Bayezid Alam wrote:
>>
>> Hi,
>>
>> I am getting below error while executing "*bin/cake bake model
>> Categories*"
>>
>> Note: i followed all the above things from http://book.cakephp.org/
>> 3.0/en/tutorials-and-examples/blog/part-three.html
>>
>> ubuntu@ubuntu:/var/www/html/cake3blog$ bin/cake bake model Categories
>>
>> Welcome to CakePHP v3.0.0 Console
>> ---
>> App : src
>> Path: /var/www/html/cake3blog/src/
>> ---
>> One moment while associations are detected.
>> Exception: SQLSTATE[42S02]: Base table or view not found: 1146 Table
>> 'blog_cake3_db.categories' doesn't exist in [/var/www/html/cake3blog/
>> vendor/cakephp/cakephp/src/Database/Schema/Collection.php, line 130]
>> 2015-03-27 04:24:32 Error: [Cake\Database\Exception] SQLSTATE[42S02]:
>> Base table or view not found: 1146 Table 'blog_cake3_db.categories' doesn't
>> exist
>> Stack Trace:
>> #0 /var/www/html/cake3blog/vendor/cakephp/cakephp/src/
>> Database/Schema/Collection.php(96): 
>> Cake\Database\Schema\Collection->_reflect('Column',
>> 'categories', Array, Object(Cake\Database\Schema\Table))
>> #1 
>> /var/www/html/cake3blog/vendor/cakephp/cakephp/src/Database/Schema/CachedCollection.php(65):
>> Cake\Database\Schema\Collection->describe('categories', Array)
>> #2 /var/www/html/cake3blog/vendor/cakephp/cakephp/src/ORM/Table.php(422):
>> Cake\Database\Schema\CachedCollection->describe('categories')
>> #3 /var/www/html/cake3blog/vendor/cakephp/cakephp/src/ORM/Table.php(498):
>> Cake\ORM\Table->schema()
>> #4 
>> /var/www/html/cake3blog/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(192):
>> Cake\ORM\Table->primaryKey()
>> #5 
>> /var/www/html/cake3blog/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(109):
>> Bake\Shell\Task\ModelTask->getAssociations(Object(Cake\ORM\Table))
>> #6 
>> /var/www/html/cake3blog/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(95):
>> Bake\Shell\Task\ModelTask->bake('Categories')
>> #7 [internal function]: Bake\Shell\Task\ModelTask->main('Categories')
>> #8 /var/www/html/cake3blog/vendor/cakephp/cakephp/src/Console/Shell.php(387):
>> call_user_func_array(Array, Array)
>> #9 /var/www/html/cake3blog/vendor/cakephp/cakephp/src/Console/Shell.php(382):
>> Cake\Console\Shell->runCommand(Array, false)
>> #10 /var/www/html/cake3blog/vendor/cakephp/cakephp/src/
>> Console/ShellDispatcher.php(200): Cake\Console\Shell->runCommand(Array,
>> true)
>> #11 /var/www/html/cake3blog/vendor/cakephp/cakephp/src/
>> Console/ShellDispatcher.php(171): Cake\Console\ShellDispatcher->
>> _dispatch()
>> #12 /var/www/html/cake3blog/vendor/cakephp/cakephp/src/
>> Console/ShellDispatcher.php(122): Cake\Console\ShellDispatcher->
>> dispatch()
>> #13 /var/www/html/cake3blog/bin/cake.php(20):
>> Cake\Console\ShellDispatcher::run(Array)
>> #14 {main}
>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Cake3 - Blog Tutorial Part 3 error founds

2015-03-26 Thread Md Bayezid Alam
Hi,

I am getting below error while executing "*bin/cake bake model Categories*"

Note: i followed all the above things from
http://book.cakephp.org/3.0/en/tutorials-and-examples/blog/part-three.html

ubuntu@ubuntu:/var/www/html/cake3blog$ bin/cake bake model Categories

Welcome to CakePHP v3.0.0 Console
---
App : src
Path: /var/www/html/cake3blog/src/
---
One moment while associations are detected.
Exception: SQLSTATE[42S02]: Base table or view not found: 1146 Table
'blog_cake3_db.categories' doesn't exist in
[/var/www/html/cake3blog/vendor/cakephp/cakephp/src/Database/Schema/Collection.php,
line 130]
2015-03-27 04:24:32 Error: [Cake\Database\Exception] SQLSTATE[42S02]: Base
table or view not found: 1146 Table 'blog_cake3_db.categories' doesn't exist
Stack Trace:
#0
/var/www/html/cake3blog/vendor/cakephp/cakephp/src/Database/Schema/Collection.php(96):
Cake\Database\Schema\Collection->_reflect('Column', 'categories', Array,
Object(Cake\Database\Schema\Table))
#1
/var/www/html/cake3blog/vendor/cakephp/cakephp/src/Database/Schema/CachedCollection.php(65):
Cake\Database\Schema\Collection->describe('categories', Array)
#2 /var/www/html/cake3blog/vendor/cakephp/cakephp/src/ORM/Table.php(422):
Cake\Database\Schema\CachedCollection->describe('categories')
#3 /var/www/html/cake3blog/vendor/cakephp/cakephp/src/ORM/Table.php(498):
Cake\ORM\Table->schema()
#4
/var/www/html/cake3blog/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(192):
Cake\ORM\Table->primaryKey()
#5
/var/www/html/cake3blog/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(109):
Bake\Shell\Task\ModelTask->getAssociations(Object(Cake\ORM\Table))
#6
/var/www/html/cake3blog/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(95):
Bake\Shell\Task\ModelTask->bake('Categories')
#7 [internal function]: Bake\Shell\Task\ModelTask->main('Categories')
#8
/var/www/html/cake3blog/vendor/cakephp/cakephp/src/Console/Shell.php(387):
call_user_func_array(Array, Array)
#9
/var/www/html/cake3blog/vendor/cakephp/cakephp/src/Console/Shell.php(382):
Cake\Console\Shell->runCommand(Array, false)
#10
/var/www/html/cake3blog/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(200):
Cake\Console\Shell->runCommand(Array, true)
#11
/var/www/html/cake3blog/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(171):
Cake\Console\ShellDispatcher->_dispatch()
#12
/var/www/html/cake3blog/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(122):
Cake\Console\ShellDispatcher->dispatch()
#13 /var/www/html/cake3blog/bin/cake.php(20):
Cake\Console\ShellDispatcher::run(Array)
#14 {main}

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 - How to add a form data using its primarykey to its associated tables

2014-12-14 Thread Md Bayezid Alam
i can't understand. could you please give me an example if you have?

Note: *I want to create a new record at Costs & FixedCosts against Units ID
but don't want to add a new record at UnitsTable*

Thanks in advance
Bayezid


On Sun, Dec 14, 2014 at 3:36 AM, José Lorenzo  wrote:
>
> You either need to load the Costs and FixedCosts associations in the get()
> call or mark the entity with isNew(false) if you want them updated instead
> of created.
>
>
> On Saturday, December 13, 2014 3:39:34 PM UTC+1, Bayezid Alam wrote:
>>
>> Thanks a lot,
>>
>> but it not saving to Costs & FixedCosts Table somehow, i tried, even if
>> its not executing after $this->request->is
>>
>>
>> public function add_cost($uId){
>> if (!$uId){
>> throw new NotFoundException(__('Unit id Not found, try with a
>> valid ID'));
>> }
>>
>> $unitId = $this->Units->get($uId);
>>
>> *$unit = $this->Units->patchEntity($unitId,
>> $this->request->data(),['associated' => ['Costs', 'FixedCosts']]);*
>>
>>   *  debug($unit); // This debug result is below*
>>
>> if ($this->request->is('post')){*// tried adding patch &
>> put too, found same result*
>> $unit->cost->unit_id = $unit->fixed_cost->unit_id =
>> $unitId->id;
>>
>> *//debug($unit); // This debug is not executing*
>>
>> if ($this->Units->save($unit)){
>> $this->Flash->success(__('The unit cost has been added'));
>> return $this->redirect(['controller' => 'houses',
>> 'action' => 'view', $unit->house_id]);
>> }
>> }
>>
>> $this->set(compact('unit'));
>> }
>>
>>
>> *debug($unit):*
>>
>> */src/Controller/UnitsController.php* (line *53*)
>>
>> object(Cake\ORM\Entity) {
>>
>>  'new' => false,
>>  'accessible' => [
>>  '*' => true
>>  ],
>>  'properties' => [
>>  'id' => (int) 1,
>>  'name' => '1st Floor - Front',
>>  'house_id' => (int) 2,
>>  'billing_date' => object(Cake\I18n\Time) {
>>
>>  'time' => '2014-12-05T00:00:00+',
>>  'timezone' => 'UTC',
>>  'fixedNowTime' => false
>>  
>>  },
>>  'created' => object(Cake\I18n\Time) {
>>
>>  'time' => '2014-12-10T14:59:25+',
>>  'timezone' => 'UTC',
>>  'fixedNowTime' => false
>>  
>>  },
>>  'modified' => object(Cake\I18n\Time) {
>>
>>  'time' => '2014-12-10T14:59:25+',
>>  'timezone' => 'UTC',
>>  'fixedNowTime' => false
>>  
>>  },
>>  'cost' => object(Cake\ORM\Entity) {
>>
>>  'new' => true,
>>  'accessible' => [
>>  '*' => true
>>  ],
>>  'properties' => [
>>  'rental_cost' => (float) 2000
>>  ],
>>  'dirty' => [
>>  'rental_cost' => true
>>  ],
>>  'original' => [],
>>  'virtual' => [],
>>  'errors' => [],
>>  'repository' => 'Costs'
>>  
>>  },
>>  'fixed_cost' => object(Cake\ORM\Entity) {
>>
>>  'new' => true,
>>  'accessible' => [
>>  '*' => true
>>  ],
>>  'properties' => [
>>  'gas_bill' => (int) 500,
>>  'water_bill' => (int) 300,
>>  'service_bill' => (int) 300
>>  ],
>>  'dirty' => [
>>  'gas_bill' => true,
>>  'water_bill' => true,
>>  'service_bill' => true
>>  ],
>>  'original' => [],
>>  'virtual' => [],
>>  'errors' => [],
>>  'repository' => 'FixedCosts'
>>  
>>  }
>>  ],
>>  'dirty' => [
>>  'cost' => true,
>>  'fixed_cost' => true
>>  ],
>>  'original' => [],
>>  'virtual' => [],
>>  'errors' => [],
>>  'repository' => 'Units'
>>
>> }
>>
>>
>> Thanks
>> Bayezid
>>
>>
>> On Sat, Dec 13, 2014 at 3:45 PM, José Lorenzo  wrote:
>>>
>>> Ah ok. I understand the question now. Instead of using newEntity() you
>>> should use patchEntity()
>>>
>>> $unitId = $this->Units->get($uId);
>>> $unit = $this->Units->patchEntity($unitId, 
>>> $this->request->data(),['associated'
>>> => ['Costs', 'FixedCosts']]);
>>>
>>>
>>> On Thursday, December 11, 2014 5:08:27 PM UTC+1, Bayezid Alam wrote:
>>>
 Hi,

Re: 3.0 - How to add a form data using its primarykey to its associated tables

2014-12-13 Thread Md Bayezid Alam
Thanks a lot,

but it not saving to Costs & FixedCosts Table somehow, i tried, even if its
not executing after $this->request->is


public function add_cost($uId){
if (!$uId){
throw new NotFoundException(__('Unit id Not found, try with a
valid ID'));
}

$unitId = $this->Units->get($uId);

*$unit = $this->Units->patchEntity($unitId,
$this->request->data(),['associated' => ['Costs', 'FixedCosts']]);*

  *  debug($unit); // This debug result is below*

if ($this->request->is('post')){*// tried adding patch &
put too, found same result*
$unit->cost->unit_id = $unit->fixed_cost->unit_id = $unitId->id;

*//debug($unit); // This debug is not executing*

if ($this->Units->save($unit)){
$this->Flash->success(__('The unit cost has been added'));
return $this->redirect(['controller' => 'houses', 'action'
=> 'view', $unit->house_id]);
}
}

$this->set(compact('unit'));
}


*debug($unit):*

*/src/Controller/UnitsController.php* (line *53*)

object(Cake\ORM\Entity) {

'new' => false,
'accessible' => [
'*' => true
],
'properties' => [
'id' => (int) 1,
'name' => '1st Floor - Front',
'house_id' => (int) 2,
'billing_date' => object(Cake\I18n\Time) {

'time' => '2014-12-05T00:00:00+',
'timezone' => 'UTC',
'fixedNowTime' => false

},
'created' => object(Cake\I18n\Time) {

'time' => '2014-12-10T14:59:25+',
'timezone' => 'UTC',
'fixedNowTime' => false

},
'modified' => object(Cake\I18n\Time) {

'time' => '2014-12-10T14:59:25+',
'timezone' => 'UTC',
'fixedNowTime' => false

},
'cost' => object(Cake\ORM\Entity) {

'new' => true,
'accessible' => [
'*' => true
],
'properties' => [
'rental_cost' => (float) 2000
],
'dirty' => [
'rental_cost' => true
],
'original' => [],
'virtual' => [],
'errors' => [],
'repository' => 'Costs'

},
'fixed_cost' => object(Cake\ORM\Entity) {

'new' => true,
'accessible' => [
'*' => true
],
'properties' => [
'gas_bill' => (int) 500,
'water_bill' => (int) 300,
'service_bill' => (int) 300
],
'dirty' => [
'gas_bill' => true,
'water_bill' => true,
'service_bill' => true
],
'original' => [],
'virtual' => [],
'errors' => [],
'repository' => 'FixedCosts'

}
],
'dirty' => [
'cost' => true,
'fixed_cost' => true
],
'original' => [],
'virtual' => [],
'errors' => [],
'repository' => 'Units'

}


Thanks
Bayezid


On Sat, Dec 13, 2014 at 3:45 PM, José Lorenzo  wrote:
>
> Ah ok. I understand the question now. Instead of using newEntity() you
> should use patchEntity()
>
> $unitId = $this->Units->get($uId);
> $unit = $this->Units->patchEntity($unitId, 
> $this->request->data(),['associated'
> => ['Costs', 'FixedCosts']]);
>
>
> On Thursday, December 11, 2014 5:08:27 PM UTC+1, Bayezid Alam wrote:
>
>> Hi,
>>
>>
>> i have Tables :
>>
>> Units hasOne costs & hasOne fixed_costs
>>
>> i want to add data to costs and fixed_costs table using units's primary
>> key from units Controller.
>>
>> i did below things but its creating a new record at unit Table instead of
>> using primaryKey
>>
>> Form at unitsController:
>>
>> >
>> echo $this->Form->create($unit);
>> echo $this->Form->input('cost.rental_cost');
>> echo $this->Form->input('fixed_cost.gas_bill');
>> echo $this->Form->input('fixed_cost.water_bill');
>> echo $this->Form->input('fixed_cost.service_bill');
>> echo $this->Form->button('Save Costs');
>> echo $this->Form->end();
>>
>> ?>
>>
>> Function at UnitsController:
>>
>> public function a

Re: 3.0 - How to add a form data using its primarykey to its associated tables

2014-12-12 Thread Md Bayezid Alam
Hello Lorenzo,


please Ignore Previous debug($unit) & find the latest debug($unit) before
all save()

*/src/Controller/UnitsController.php* (line *59*)

object(Cake\ORM\Entity) {

'new' => true,
'accessible' => [
'*' => true
],
'properties' => [
'cost' => object(Cake\ORM\Entity) {

'new' => true,
'accessible' => [
'*' => true
],
'properties' => [
'rental_cost' => (float) 14500,
'unit_id' => (int) 1
],
'dirty' => [
'rental_cost' => true,
'unit_id' => true
],
'original' => [],
'virtual' => [],
'errors' => [],
'repository' => 'Costs'

},
'fixed_cost' => object(Cake\ORM\Entity) {

'new' => true,
'accessible' => [
'*' => true
],
'properties' => [
'gas_bill' => (int) 450,
'water_bill' => (int) 600,
'service_bill' => (int) 500,
'unit_id' => (int) 1
],
'dirty' => [
'gas_bill' => true,
'water_bill' => true,
'service_bill' => true,
'unit_id' => true
],
'original' => [],
'virtual' => [],
        'errors' => [],
'repository' => 'FixedCosts'

}
],
'dirty' => [
'cost' => true,
'fixed_cost' => true
],
'original' => [],
'virtual' => [],
'errors' => [],
'repository' => 'Units'

}


Note: A new record is being saved in UnitsTable but i don't want to


Thanks

Bayezid



On Fri, Dec 12, 2014 at 10:35 PM, Md Bayezid Alam 
wrote:
>
> Hello Lerenzo,
>
> Please find the UnitsTable and debug($unit) as follows:
>
> *UnitsTable:*
>
>  namespace App\Model\Table;
>
> use Cake\ORM\Table;
>
> class UnitsTable extends Table {
>
> public function initialize(array $config) {
> $this->table('units');
> $this->addBehavior('Timestamp');
> $this->primaryKey('id');
>
> // association goes here
> $this->belongsTo('Houses',[
> 'foreignKey' => 'house_id'
> ]);
>
> $this->hasOne('Costs',[
> 'foreignKey' => 'unit_id'
> ]);
>
> $this->hasOne('FixedCosts',[
> 'foreignKey' => 'unit_id'
> ]);
>
> }
> }
>
> ?>
>
> *debug($unit):*
>
> */src/Controller/UnitsController.php* (line *53*)
>
> object(Cake\ORM\Entity) {
>
>   'new' => true,
>   'accessible' => [
>   '*' => true
>   ],
>   'properties' => [
>   'cost' => object(Cake\ORM\Entity) {
>
>   'new' => true,
>   'accessible' => [
>   '*' => true
>   ],
>   'properties' => [
>   'rental_cost' => (float) 14500
>   ],
>   'dirty' => [
>   'rental_cost' => true
>   ],
>   'original' => [],
>   'virtual' => [],
>

Re: 3.0 - How to add a form data using its primarykey to its associated tables

2014-12-12 Thread Md Bayezid Alam
Hello Lerenzo,

Please find the UnitsTable and debug($unit) as follows:

*UnitsTable:*

table('units');
$this->addBehavior('Timestamp');
$this->primaryKey('id');

// association goes here
$this->belongsTo('Houses',[
'foreignKey' => 'house_id'
]);

$this->hasOne('Costs',[
'foreignKey' => 'unit_id'
]);

$this->hasOne('FixedCosts',[
'foreignKey' => 'unit_id'
]);

}
}

?>

*debug($unit):*

*/src/Controller/UnitsController.php* (line *53*)

object(Cake\ORM\Entity) {

'new' => true,
'accessible' => [
'*' => true
],
'properties' => [
'cost' => object(Cake\ORM\Entity) {

'new' => true,
'accessible' => [
'*' => true
],
'properties' => [
'rental_cost' => (float) 14500
],
'dirty' => [
'rental_cost' => true
],
'original' => [],
'virtual' => [],
'errors' => [],
'repository' => 'Costs'

},
'fixed_cost' => object(Cake\ORM\Entity) {

'new' => true,
'accessible' => [
'*' => true
],
'properties' => [
'gas_bill' => (int) 450,
'water_bill' => (int) 600,
'service_bill' => (int) 500
],
'dirty' => [
'gas_bill' => true,
'water_bill' => true,
'service_bill' => true
],
'original' => [],
'virtual' => [],
'errors' => [],
'repository' => 'FixedCosts'

}
],
'dirty' => [
'cost' => true,
'fixed_cost' => true
],
'original' => [],
'virtual' => [],
'errors' => [],
'repository' => 'Units'

}


Thanks
Bayezid

On Fri, Dec 12, 2014 at 3:02 PM, José Lorenzo  wrote:
>
> Can you show how your UnitsTable look like? Can you also show a
> debug($unit) before you all save() ?
>
>
> On Thursday, December 11, 2014 5:08:27 PM UTC+1, Bayezid Alam wrote:
>>
>> Hi,
>>
>>
>> i have Tables :
>>
>> Units hasOne costs & hasOne fixed_costs
>>
>> i want to add data to costs and fixed_costs table using units's primary
>> key from units Controller.
>>
>> i did below things but its creating a new record at unit Table instead of
>> using primaryKey
>>
>> Form at unitsController:
>>
>> >
>> echo $this->Form->create($unit);
>> echo $this->Form->input('cost.rental_cost');
>> echo $this->Form->input('fixed_cost.gas_bill');
>> echo $this->Form->input('fixed_cost.water_bill');
>> echo $this->Form->input('fixed_cost.service_bill');
>> echo $this->Form->button('Save Costs');
>> echo $this->Form->end();
>>
>> ?>
>>
>> Function at UnitsController:
>>
>> public function add_cost($uId){
>> if (!$uId){
>> throw new NotFoundException(__('Unit id Not found, try with a
>> valid ID'));
>> }
>>
>> $unitId = $this->Units->get($uId);
>>
>> $unit = $this->Units->newEntity($this->request->data(),['associated'
>> => ['Costs', 'FixedCosts']]);
>>
>> if ($this->request->is('post')){
>> $unit->cost->unit_id = $unit->fixed_cost->unit_id =
>> $unitId->id;
>> if ($this->Units->save($unit)){
>> $this->Flash->success(__('The unit cost has been added'));
>> return $this->redirect(['controller' => 'houses',
>> 'action' => 'view', $unit->house_id]);
>> }
>> }
>>
>> $this->set(compact('unit'));
>> }
>>
>> Please suggest me on this regard.
>>
>> Thanks
>> Bayezid
>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubs

Re: 3.0 - How to add a form data using its primarykey to its associated tables

2014-12-11 Thread Md Bayezid Alam
HI

May i get a suggestion on this?

I did google but found nothing.

Thanks
Bayezid

On Thu, Dec 11, 2014 at 10:07 PM, Md Bayezid Alam 
wrote:
>
> Hi,
>
>
> i have Tables :
>
> Units hasOne costs & hasOne fixed_costs
>
> i want to add data to costs and fixed_costs table using units's primary
> key from units Controller.
>
> i did below things but its creating a new record at unit Table instead of
> using primaryKey
>
> Form at unitsController Template:
>
> 
> echo $this->Form->create($unit);
> echo $this->Form->input('cost.rental_cost');
> echo $this->Form->input('fixed_cost.gas_bill');
> echo $this->Form->input('fixed_cost.water_bill');
> echo $this->Form->input('fixed_cost.service_bill');
> echo $this->Form->button('Save Costs');
> echo $this->Form->end();
>
> ?>
>
> Function at UnitsController:
>
> public function add_cost($uId){
> if (!$uId){
> throw new NotFoundException(__('Unit id Not found, try with a
> valid ID'));
> }
>
> $unitId = $this->Units->get($uId);
>
> $unit =
> $this->Units->newEntity($this->request->data(),['associated' => ['Costs',
> 'FixedCosts']]);
>
> if ($this->request->is('post')){
> $unit->cost->unit_id = $unit->fixed_cost->unit_id =
> $unitId->id;
> if ($this->Units->save($unit)){
> $this->Flash->success(__('The unit cost has been added'));
> return $this->redirect(['controller' => 'houses', 'action'
> => 'view', $unit->house_id]);
> }
> }
>
> $this->set(compact('unit'));
> }
>
> Please suggest me on this regard.
>
> Thanks
> Bayezid
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


3.0 - How to add a form data using its primarykey to its associated tables

2014-12-11 Thread Md Bayezid Alam
Hi,


i have Tables :

Units hasOne costs & hasOne fixed_costs

i want to add data to costs and fixed_costs table using units's primary key
from units Controller.

i did below things but its creating a new record at unit Table instead of
using primaryKey

Form at unitsController:

Form->create($unit);
echo $this->Form->input('cost.rental_cost');
echo $this->Form->input('fixed_cost.gas_bill');
echo $this->Form->input('fixed_cost.water_bill');
echo $this->Form->input('fixed_cost.service_bill');
echo $this->Form->button('Save Costs');
echo $this->Form->end();

?>

Function at UnitsController:

public function add_cost($uId){
if (!$uId){
throw new NotFoundException(__('Unit id Not found, try with a
valid ID'));
}

$unitId = $this->Units->get($uId);

$unit =
$this->Units->newEntity($this->request->data(),['associated' => ['Costs',
'FixedCosts']]);

if ($this->request->is('post')){
$unit->cost->unit_id = $unit->fixed_cost->unit_id = $unitId->id;
if ($this->Units->save($unit)){
$this->Flash->success(__('The unit cost has been added'));
return $this->redirect(['controller' => 'houses', 'action'
=> 'view', $unit->house_id]);
}
}

$this->set(compact('unit'));
}

Please suggest me on this regard.

Thanks
Bayezid

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Cakephp 3.0 - How to apply condition at find list method

2014-11-20 Thread Md Bayezid Alam
Thanks a lot @*Leandro Machado Pereira *

i tried & working fine
$departments = $this->Companies->Departments->find('list')->select(['id',
'name'])->where(['company_id' => $company->id]);

Bayezid

On Thu, Nov 20, 2014 at 8:35 PM, Leandro Machado Pereira <
llperei...@gmail.com> wrote:

> Hi Dear,
>
> see this:
> http://book.cakephp.org/3.0/en/orm/query-builder.html#the-query-object
>
> try this:
>
> $departments = $this->Companies->Departments->find('list')
>   ->select(['id', 'name'])
>   ->where(['id !=' => 1])
>   ->order(['created' => 'DESC']);
>
>
> Em Thu Nov 20 2014 at 12:07:22, Md Bayezid Alam 
> escreveu:
>
>> Dear All,
>>
>> How do i apply condition at find('list') at Cakephp 3.0?
>>
>> i have a Companies, Departments and Employees
>>
>> Companies hasMany Department.
>> Companies hasMany Employees
>> Departments has Many Employees.
>>
>> i want to add Employees from company & want to get departments list of
>> that company.
>>
>> My Add method:
>>
>> public function add($companyId = null){
>>
>> if (!$companyId){
>> throw new NotFoundException(__('A Company is required'));
>> }
>>
>> $this->loadModel('Companies');
>>
>> $company = $this->Companies->get($companyId);
>>
>> $employee = $this->Employees->newEntity($this->request->data);
>>
>> if ($this->request->is('post')){
>> $employee->company_id = $company->id;
>> if ($this->Employees->save($employee)){
>> $this->Flash->success(__('The employee has been added
>> successfully'));
>> return $this->redirect(['action' => 'index']);
>> } else {
>> $this->Flash->error(__('Unable to add the employee,
>> please try again'));
>> }
>> }
>>
>>
>> $departments = $this->Companies->Departments->find('list'); *//
>> Here, Want to get only Departments lists of that company passed through
>> $companyId *
>>
>> $this->set(compact('employee','departments'));
>> }
>>
>> Could you please help suggesting me on this regard?
>>
>> *Note: Sorry for my bad **English*
>>
>> Thanks
>> Bayezid
>>
>> --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to cake-php+unsubscr...@googlegroups.com.
>> To post to this group, send email to cake-php@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Cakephp 3.0 - How to apply condition at find list method

2014-11-20 Thread Md Bayezid Alam
Dear All,

How do i apply condition at find('list') at Cakephp 3.0?

i have a Companies, Departments and Employees

Companies hasMany Department.
Companies hasMany Employees
Departments has Many Employees.

i want to add Employees from company & want to get departments list of that
company.

My Add method:

public function add($companyId = null){

if (!$companyId){
throw new NotFoundException(__('A Company is required'));
}

$this->loadModel('Companies');

$company = $this->Companies->get($companyId);

$employee = $this->Employees->newEntity($this->request->data);

if ($this->request->is('post')){
$employee->company_id = $company->id;
if ($this->Employees->save($employee)){
$this->Flash->success(__('The employee has been added
successfully'));
return $this->redirect(['action' => 'index']);
} else {
$this->Flash->error(__('Unable to add the employee, please
try again'));
}
}


$departments = $this->Companies->Departments->find('list'); *//
Here, Want to get only Departments lists of that company passed through
$companyId *

$this->set(compact('employee','departments'));
}

Could you please help suggesting me on this regard?

*Note: Sorry for my bad **English*

Thanks
Bayezid

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Can't visit controllers/* Cakephp 3

2014-10-24 Thread Md Bayezid Alam
Thanks a lot, it was a configuration issue.

I did just below configuration

Options Indexes FollowSymLinks
AllowOverride None
Require all granted


to


Options Indexes FollowSymLinks
AllowOverride all
Require all granted



Thanks :)
Bayezid

On Fri, Oct 24, 2014 at 3:28 PM, Stephen S  wrote:

> Definitely seems like a htaccess / mod_rewrite issue. You can probably
> access the CSS by typing
> http://localhost/bookmarkrs/app/webroot/css/cake.generic.css when really
> it should be http://localhost/bookmarkrs/css/cake.generic.css
>
> http://book.cakephp.org/2.0/en/installation/url-rewriting.html
>
> On 24 October 2014 10:11, Radharadhya Dasa  wrote:
>
>> Your localhost/bookmarkrs page does not shown properly, it seems css is
>> missing. It is strange, because the logo image is loaded. I would guess you
>> have some folder / file permission error. If you followed the example
>> there, than it should work. You could try to check apache and cakephp error
>> log, maybe they will say something useful
>>
>> --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to cake-php+unsubscr...@googlegroups.com.
>> To post to this group, send email to cake-php@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Kind Regards
>  Stephen Speakman
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 Database Error : SQLSTATE[HY000] [14] unable to open database file

2014-09-29 Thread Md Bayezid Alam
Sorry, i got the answer, it was an issue of permission..

Thanks

On Mon, Sep 29, 2014 at 9:42 PM, Md Bayezid Alam 
wrote:

> Dear All,
> i am getting the subjected Error for beta-2 of cake3, while first browsing
> from localhost.
>
> sub-hints:
> If you are using SQL keywords as table column names, you can enable
> identifier quoting for your database connection in config/app.php.
>
> *Notice: * If you want to customize this error message, create
> src/Template/Error/pdo_error.ctp
>
> Stack Trace
>
>- CORE/src/Database/Driver/PDODriverTrait.php line 44
><http://localhost/cake3b2/#> → PDO->__construct(string, null, null,
>array) <http://localhost/cake3b2/#>
>- CORE/src/Database/Driver/Sqlite.php line 62
><http://localhost/cake3b2/#> →
>Cake\Database\Driver\Sqlite->_connect(array)
><http://localhost/cake3b2/#>
>- CORE/src/Database/Schema/BaseSchema.php line 44
><http://localhost/cake3b2/#> → Cake\Database\Driver\Sqlite->connect()
><http://localhost/cake3b2/#>
>- CORE/src/Database/Dialect/SqliteDialectTrait.php line 163
><http://localhost/cake3b2/#> →
>Cake\Database\Schema\BaseSchema->__construct(Cake\Database\Driver\Sqlite)
><http://localhost/cake3b2/#>
>- CORE/src/Database/Schema/Collection.php line 59
><http://localhost/cake3b2/#> →
>Cake\Database\Driver\Sqlite->schemaDialect()
><http://localhost/cake3b2/#>
>- CORE/src/Database/Connection.php line 288
><http://localhost/cake3b2/#> →
>Cake\Database\Schema\Collection->__construct(Cake\Database\Connection)
><http://localhost/cake3b2/#>
>- ROOT/plugins/DebugKit/src/Model/Table/LazyTableTrait.php line 38
><http://localhost/cake3b2/#> →
>Cake\Database\Connection->schemaCollection()
><http://localhost/cake3b2/#>
>- ROOT/plugins/DebugKit/src/Model/Table/RequestsTable.php line 41
><http://localhost/cake3b2/#> →
>DebugKit\Model\Table\RequestsTable->ensureTables(array)
><http://localhost/cake3b2/#>
>- CORE/src/ORM/Table.php line 231 <http://localhost/cake3b2/#> →
>DebugKit\Model\Table\RequestsTable->initialize(array)
><http://localhost/cake3b2/#>
>- CORE/src/ORM/TableRegistry.php line 186 <http://localhost/cake3b2/#>
>→ Cake\ORM\Table->__construct(array) <http://localhost/cake3b2/#>
>- ROOT/plugins/DebugKit/src/Routing/Filter/DebugBarFilter.php line 178
><http://localhost/cake3b2/#> → Cake\ORM\TableRegistry::get(string)
><http://localhost/cake3b2/#>
>- CORE/src/Event/EventManager.php line 268 <http://localhost/cake3b2/#>
>→ DebugKit\Routing\Filter\DebugBarFilter->afterDispatch(Cake\Event\Event,
>Cake\Network\Request, Cake\Network\Response)
><http://localhost/cake3b2/#>
>- CORE/src/Event/EventManager.php line 235 <http://localhost/cake3b2/#>
>→ Cake\Event\EventManager->_callListener(array, Cake\Event\Event)
><http://localhost/cake3b2/#>
>- CORE/src/Event/EventManagerTrait.php line 76
><http://localhost/cake3b2/#> →
>Cake\Event\EventManager->dispatch(Cake\Event\Event)
><http://localhost/cake3b2/#>
>- CORE/src/Routing/Dispatcher.php line 90 <http://localhost/cake3b2/#>
>→ Cake\Routing\Dispatcher->dispatchEvent(string, array)
><http://localhost/cake3b2/#>
>- ROOT/webroot/index.php line 37 <http://localhost/cake3b2/#> → 
> Cake\Routing\Dispatcher->dispatch(Cake\Network\Request,
>Cake\Network\Response) <http://localhost/cake3b2/#>
>
>
> Note: i have manually downloaded from
> https://github.com/cakephp/cakephp/releases/3.0.0-beta2
>
> Hope it's proper suggestion
>
> Thanks
> Bayezid
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


3.0 Database Error : SQLSTATE[HY000] [14] unable to open database file

2014-09-29 Thread Md Bayezid Alam
Dear All,
i am getting the subjected Error for beta-2 of cake3, while first browsing
from localhost.

sub-hints:
If you are using SQL keywords as table column names, you can enable
identifier quoting for your database connection in config/app.php.

*Notice: * If you want to customize this error message, create
src/Template/Error/pdo_error.ctp

Stack Trace

   - CORE/src/Database/Driver/PDODriverTrait.php line 44
    → PDO->__construct(string, null, null,
   array) 
   - CORE/src/Database/Driver/Sqlite.php line 62
    →
   Cake\Database\Driver\Sqlite->_connect(array) 
   - CORE/src/Database/Schema/BaseSchema.php line 44
    → Cake\Database\Driver\Sqlite->connect()
   
   - CORE/src/Database/Dialect/SqliteDialectTrait.php line 163
    →
   Cake\Database\Schema\BaseSchema->__construct(Cake\Database\Driver\Sqlite)
   
   - CORE/src/Database/Schema/Collection.php line 59
    →
   Cake\Database\Driver\Sqlite->schemaDialect() 
   - CORE/src/Database/Connection.php line 288 
   → Cake\Database\Schema\Collection->__construct(Cake\Database\Connection)
   
   - ROOT/plugins/DebugKit/src/Model/Table/LazyTableTrait.php line 38
    →
   Cake\Database\Connection->schemaCollection() 
   - ROOT/plugins/DebugKit/src/Model/Table/RequestsTable.php line 41
    →
   DebugKit\Model\Table\RequestsTable->ensureTables(array)
   
   - CORE/src/ORM/Table.php line 231  →
   DebugKit\Model\Table\RequestsTable->initialize(array)
   
   - CORE/src/ORM/TableRegistry.php line 186  →
   Cake\ORM\Table->__construct(array) 
   - ROOT/plugins/DebugKit/src/Routing/Filter/DebugBarFilter.php line 178
    → Cake\ORM\TableRegistry::get(string)
   
   - CORE/src/Event/EventManager.php line 268 
   → DebugKit\Routing\Filter\DebugBarFilter->afterDispatch(Cake\Event\Event,
   Cake\Network\Request, Cake\Network\Response) 
   - CORE/src/Event/EventManager.php line 235 
   → Cake\Event\EventManager->_callListener(array, Cake\Event\Event)
   
   - CORE/src/Event/EventManagerTrait.php line 76
    →
   Cake\Event\EventManager->dispatch(Cake\Event\Event)
   
   - CORE/src/Routing/Dispatcher.php line 90
 →
Cake\Routing\Dispatcher->dispatchEvent(string,
   array) 
   - ROOT/webroot/index.php line 37  →
Cake\Routing\Dispatcher->dispatch(Cake\Network\Request,
   Cake\Network\Response) 


Note: i have manually downloaded from
https://github.com/cakephp/cakephp/releases/3.0.0-beta2

Hope it's proper suggestion

Thanks
Bayezid

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 - Saving data using Form with HasOne relationship

2014-05-20 Thread Md Bayezid Alam
Wow, its really good. Thanks


On Wed, May 21, 2014 at 12:06 AM, José Lorenzo  wrote:

> That means you have your php and the cakephp database connection
> configured to use UTC. That is a good thing though, it is better to manage
> dates in UTC and display them in the local user timezone.
>
> You would normally do, for example:
>
> echo $myEntity->created->nice('Europe/Paris');
>
> On Tuesday, May 20, 2014 7:32:45 PM UTC+2, Bayezid Alam wrote:
>>
>> When i save a record, the date and time are saving in database 6 hrs back
>> from my local time ( My time is GMT+6). In that sense i called it GMT.
>>
>> Example: I saved a data at *5/20/14, 11:24 PM* (My Local Time, GMT+6)
>> but The record is saving in DB at *5/20/14, 5:24 PM* ( which is GMT).
>>
>> Hope it clarify the things & sorry for the inconvenience.
>>
>> Thanks
>> Bayezid
>>
>>
>>
>> On Tue, May 20, 2014 at 1:48 AM, José Lorenzo  wrote:
>>
>>> what do you mean it is working as gmt?
>>>
>>>
>>> On Monday, May 19, 2014 7:55:10 PM UTC+2, Bayezid Alam wrote:
>>>>
>>>> Thanks Jose, its working as GMT but format() function is not working
>>>> here
>>>>
>>>>
>>>> On Mon, May 19, 2014 at 9:28 PM, Md Bayezid Alam 
>>>> wrote:
>>>>
>>>>> I added Timestamp behavior at ArticlesTable
>>>>>
>>>>> public function initialize(array $config) {
>>>>> $this->addBehavior('Timestamp');
>>>>> }
>>>>>
>>>>> but same fatal error is showing
>>>>>
>>>>>
>>>>>
>>>>> *Error: Call to a member function format() on a non-object
>>>>> File /var/www/html/test3/App/Template/Profiles/index.ctp Line: 22 ( 
>>>>> >>>> h($profile->created->format(DATE_RFC850)) ?> )*
>>>>>
>>>>> *Tried both format() and removing format().*
>>>>>
>>>>> Without format() method, it is saving date as NULL.
>>>>>
>>>>>
>>>>>
>>>>> On Mon, May 19, 2014 at 7:46 PM, Md Bayezid Alam >>>> > wrote:
>>>>>
>>>>>> Nope, i did not.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Mon, May 19, 2014 at 7:32 PM, José Lorenzo wrote:
>>>>>>
>>>>>>> Did you add the Timestamp behavior to your Profiles table?
>>>>>>>
>>>>>>>
>>>>>>> On Monday, May 19, 2014 3:17:39 PM UTC+2, Bayezid Alam wrote:
>>>>>>>>
>>>>>>>> Thanks a lot, i changed from username to user_id and its working
>>>>>>>> perfectly
>>>>>>>>
>>>>>>>> but the second one is not working
>>>>>>>>
>>>>>>>> here is my table structure
>>>>>>>>
>>>>>>>>  *CREATE TABLE IF NOT EXISTS `profiles` (*
>>>>>>>> *  `id` int(11) NOT NULL AUTO_INCREMENT,*
>>>>>>>> *  `name` varchar(40) NOT NULL,*
>>>>>>>> *  `address` varchar(70) NOT NULL,*
>>>>>>>> *  `email` varchar(30) NOT NULL,*
>>>>>>>> *  `mobile` varchar(20) NOT NULL,*
>>>>>>>> *  `user_id` int(11) NOT NULL,*
>>>>>>>> *  `created` datetime DEFAULT NULL,*
>>>>>>>> *  `modified` datetime NOT NULL,*
>>>>>>>> *  PRIMARY KEY (`id`)*
>>>>>>>> *) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ;*
>>>>>>>>
>>>>>>>> *Below error is showing:*
>>>>>>>>
>>>>>>>> *Error: * Call to a member function format() on a non-object
>>>>>>>> *File* /var/www/html/test3/App/Template/Profiles/index.ctp
>>>>>>>> *Line: * 22 ( created->format(DATE_RFC850))
>>>>>>>> ?> )
>>>>>>>>
>>>>>>>> After removing Format(Date_RFC850)), the data is saving but created
>>>>>>>> field is entered as NULL.
>>>>>>>>
>>>>>>>> Thanks again
>>>>>>>> Bayezid
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, 

Re: 3.0 - Saving data using Form with HasOne relationship

2014-05-20 Thread Md Bayezid Alam
When i save a record, the date and time are saving in database 6 hrs back
from my local time ( My time is GMT+6). In that sense i called it GMT.

Example: I saved a data at *5/20/14, 11:24 PM* (My Local Time, GMT+6) but
The record is saving in DB at *5/20/14, 5:24 PM* ( which is GMT).

Hope it clarify the things & sorry for the inconvenience.

Thanks
Bayezid



On Tue, May 20, 2014 at 1:48 AM, José Lorenzo  wrote:

> what do you mean it is working as gmt?
>
>
> On Monday, May 19, 2014 7:55:10 PM UTC+2, Bayezid Alam wrote:
>>
>> Thanks Jose, its working as GMT but format() function is not working here
>>
>>
>> On Mon, May 19, 2014 at 9:28 PM, Md Bayezid Alam wrote:
>>
>>> I added Timestamp behavior at ArticlesTable
>>>
>>> public function initialize(array $config) {
>>> $this->addBehavior('Timestamp');
>>> }
>>>
>>> but same fatal error is showing
>>>
>>>
>>>
>>> *Error: Call to a member function format() on a non-object
>>> File /var/www/html/test3/App/Template/Profiles/index.ctp Line: 22 ( >> h($profile->created->format(DATE_RFC850)) ?> )*
>>>
>>> *Tried both format() and removing format().*
>>>
>>> Without format() method, it is saving date as NULL.
>>>
>>>
>>>
>>> On Mon, May 19, 2014 at 7:46 PM, Md Bayezid Alam 
>>> wrote:
>>>
>>>> Nope, i did not.
>>>>
>>>>
>>>>
>>>>
>>>> On Mon, May 19, 2014 at 7:32 PM, José Lorenzo wrote:
>>>>
>>>>> Did you add the Timestamp behavior to your Profiles table?
>>>>>
>>>>>
>>>>> On Monday, May 19, 2014 3:17:39 PM UTC+2, Bayezid Alam wrote:
>>>>>>
>>>>>> Thanks a lot, i changed from username to user_id and its working
>>>>>> perfectly
>>>>>>
>>>>>> but the second one is not working
>>>>>>
>>>>>> here is my table structure
>>>>>>
>>>>>>  *CREATE TABLE IF NOT EXISTS `profiles` (*
>>>>>> *  `id` int(11) NOT NULL AUTO_INCREMENT,*
>>>>>> *  `name` varchar(40) NOT NULL,*
>>>>>> *  `address` varchar(70) NOT NULL,*
>>>>>> *  `email` varchar(30) NOT NULL,*
>>>>>> *  `mobile` varchar(20) NOT NULL,*
>>>>>> *  `user_id` int(11) NOT NULL,*
>>>>>> *  `created` datetime DEFAULT NULL,*
>>>>>> *  `modified` datetime NOT NULL,*
>>>>>> *  PRIMARY KEY (`id`)*
>>>>>> *) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ;*
>>>>>>
>>>>>> *Below error is showing:*
>>>>>>
>>>>>> *Error: * Call to a member function format() on a non-object
>>>>>> *File* /var/www/html/test3/App/Template/Profiles/index.ctp
>>>>>> *Line: * 22 ( created->format(DATE_RFC850))
>>>>>> ?> )
>>>>>>
>>>>>> After removing Format(Date_RFC850)), the data is saving but created
>>>>>> field is entered as NULL.
>>>>>>
>>>>>> Thanks again
>>>>>> Bayezid
>>>>>>
>>>>>>
>>>>>> On Mon, May 19, 2014 at 10:03 AM, Dakota wrote:
>>>>>>
>>>>>>> The line echo $this->Form->input('username', ['options' => $pUser]);
>>>>>>> should be 'user_id'. Also, if the variable is 'users' cakephp will
>>>>>>> automatically pick it up as the options for the field.
>>>>>>>
>>>>>>> Check that your created field allows null with default null.
>>>>>>>
>>>>>>> --
>>>>>>> Like Us on FaceBook https://www.facebook.com/CakePHP
>>>>>>> Find us on Twitter http://twitter.com/CakePHP
>>>>>>>
>>>>>>> ---
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "CakePHP" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to cake-php+unsubscr...@googlegroups.com.
>>>>>>> To post to this group, send email to cake-php@googlegroups.com.
>>>>>>> Visit this group at http://groups.google.com/group/cake-php.
>&g

Re: 3.0 - Saving data using Form with HasOne relationship

2014-05-19 Thread Md Bayezid Alam
Thanks Jose, its working as GMT but format() function is not working here


On Mon, May 19, 2014 at 9:28 PM, Md Bayezid Alam wrote:

> I added Timestamp behavior at ArticlesTable
>
> public function initialize(array $config) {
> $this->addBehavior('Timestamp');
> }
>
> but same fatal error is showing
>
>
>
> *Error: Call to a member function format() on a non-object
> File /var/www/html/test3/App/Template/Profiles/index.ctp Line: 22 (  h($profile->created->format(DATE_RFC850)) ?> )*
>
> *Tried both format() and removing format().*
>
> Without format() method, it is saving date as NULL.
>
>
>
> On Mon, May 19, 2014 at 7:46 PM, Md Bayezid Alam wrote:
>
>> Nope, i did not.
>>
>>
>>
>>
>> On Mon, May 19, 2014 at 7:32 PM, José Lorenzo  wrote:
>>
>>> Did you add the Timestamp behavior to your Profiles table?
>>>
>>>
>>> On Monday, May 19, 2014 3:17:39 PM UTC+2, Bayezid Alam wrote:
>>>>
>>>> Thanks a lot, i changed from username to user_id and its working
>>>> perfectly
>>>>
>>>> but the second one is not working
>>>>
>>>> here is my table structure
>>>>
>>>>  *CREATE TABLE IF NOT EXISTS `profiles` (*
>>>> *  `id` int(11) NOT NULL AUTO_INCREMENT,*
>>>> *  `name` varchar(40) NOT NULL,*
>>>> *  `address` varchar(70) NOT NULL,*
>>>> *  `email` varchar(30) NOT NULL,*
>>>> *  `mobile` varchar(20) NOT NULL,*
>>>> *  `user_id` int(11) NOT NULL,*
>>>> *  `created` datetime DEFAULT NULL,*
>>>> *  `modified` datetime NOT NULL,*
>>>> *  PRIMARY KEY (`id`)*
>>>> *) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ;*
>>>>
>>>> *Below error is showing:*
>>>>
>>>> *Error: * Call to a member function format() on a non-object
>>>> *File* /var/www/html/test3/App/Template/Profiles/index.ctp
>>>> *Line: * 22 ( created->format(DATE_RFC850))
>>>> ?> )
>>>>
>>>> After removing Format(Date_RFC850)), the data is saving but created
>>>> field is entered as NULL.
>>>>
>>>> Thanks again
>>>> Bayezid
>>>>
>>>>
>>>> On Mon, May 19, 2014 at 10:03 AM, Dakota  wrote:
>>>>
>>>>> The line echo $this->Form->input('username', ['options' => $pUser]);
>>>>> should be 'user_id'. Also, if the variable is 'users' cakephp will
>>>>> automatically pick it up as the options for the field.
>>>>>
>>>>> Check that your created field allows null with default null.
>>>>>
>>>>> --
>>>>> Like Us on FaceBook https://www.facebook.com/CakePHP
>>>>> Find us on Twitter http://twitter.com/CakePHP
>>>>>
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "CakePHP" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to cake-php+unsubscr...@googlegroups.com.
>>>>> To post to this group, send email to cake-php@googlegroups.com.
>>>>> Visit this group at http://groups.google.com/group/cake-php.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>  --
>>> Like Us on FaceBook https://www.facebook.com/CakePHP
>>> Find us on Twitter http://twitter.com/CakePHP
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "CakePHP" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to cake-php+unsubscr...@googlegroups.com.
>>> To post to this group, send email to cake-php@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/cake-php.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 - Saving data using Form with HasOne relationship

2014-05-19 Thread Md Bayezid Alam
I added Timestamp behavior at ArticlesTable

public function initialize(array $config) {
$this->addBehavior('Timestamp');
}

but same fatal error is showing



*Error: Call to a member function format() on a non-object
File /var/www/html/test3/App/Template/Profiles/index.ctp Line: 22 ( created->format(DATE_RFC850)) ?> )*

*Tried both format() and removing format().*

Without format() method, it is saving date as NULL.



On Mon, May 19, 2014 at 7:46 PM, Md Bayezid Alam wrote:

> Nope, i did not.
>
>
>
>
> On Mon, May 19, 2014 at 7:32 PM, José Lorenzo  wrote:
>
>> Did you add the Timestamp behavior to your Profiles table?
>>
>>
>> On Monday, May 19, 2014 3:17:39 PM UTC+2, Bayezid Alam wrote:
>>>
>>> Thanks a lot, i changed from username to user_id and its working
>>> perfectly
>>>
>>> but the second one is not working
>>>
>>> here is my table structure
>>>
>>> *CREATE TABLE IF NOT EXISTS `profiles` (*
>>> *  `id` int(11) NOT NULL AUTO_INCREMENT,*
>>> *  `name` varchar(40) NOT NULL,*
>>> *  `address` varchar(70) NOT NULL,*
>>> *  `email` varchar(30) NOT NULL,*
>>> *  `mobile` varchar(20) NOT NULL,*
>>> *  `user_id` int(11) NOT NULL,*
>>> *  `created` datetime DEFAULT NULL,*
>>> *  `modified` datetime NOT NULL,*
>>> *  PRIMARY KEY (`id`)*
>>> *) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ;*
>>>
>>> *Below error is showing:*
>>>
>>> *Error: * Call to a member function format() on a non-object
>>> *File* /var/www/html/test3/App/Template/Profiles/index.ctp
>>> *Line: * 22 ( created->format(DATE_RFC850)) ?>
>>> )
>>>
>>> After removing Format(Date_RFC850)), the data is saving but created
>>> field is entered as NULL.
>>>
>>> Thanks again
>>> Bayezid
>>>
>>>
>>> On Mon, May 19, 2014 at 10:03 AM, Dakota  wrote:
>>>
>>>> The line echo $this->Form->input('username', ['options' => $pUser]);
>>>> should be 'user_id'. Also, if the variable is 'users' cakephp will
>>>> automatically pick it up as the options for the field.
>>>>
>>>> Check that your created field allows null with default null.
>>>>
>>>> --
>>>> Like Us on FaceBook https://www.facebook.com/CakePHP
>>>> Find us on Twitter http://twitter.com/CakePHP
>>>>
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "CakePHP" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to cake-php+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to cake-php@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/cake-php.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to cake-php+unsubscr...@googlegroups.com.
>> To post to this group, send email to cake-php@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 - Saving data using Form with HasOne relationship

2014-05-19 Thread Md Bayezid Alam
Nope, i did not.




On Mon, May 19, 2014 at 7:32 PM, José Lorenzo  wrote:

> Did you add the Timestamp behavior to your Profiles table?
>
>
> On Monday, May 19, 2014 3:17:39 PM UTC+2, Bayezid Alam wrote:
>>
>> Thanks a lot, i changed from username to user_id and its working perfectly
>>
>> but the second one is not working
>>
>> here is my table structure
>>
>> *CREATE TABLE IF NOT EXISTS `profiles` (*
>> *  `id` int(11) NOT NULL AUTO_INCREMENT,*
>> *  `name` varchar(40) NOT NULL,*
>> *  `address` varchar(70) NOT NULL,*
>> *  `email` varchar(30) NOT NULL,*
>> *  `mobile` varchar(20) NOT NULL,*
>> *  `user_id` int(11) NOT NULL,*
>> *  `created` datetime DEFAULT NULL,*
>> *  `modified` datetime NOT NULL,*
>> *  PRIMARY KEY (`id`)*
>> *) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ;*
>>
>> *Below error is showing:*
>>
>> *Error: * Call to a member function format() on a non-object
>> *File* /var/www/html/test3/App/Template/Profiles/index.ctp
>> *Line: * 22 ( created->format(DATE_RFC850)) ?> )
>>
>> After removing Format(Date_RFC850)), the data is saving but created field
>> is entered as NULL.
>>
>> Thanks again
>> Bayezid
>>
>>
>> On Mon, May 19, 2014 at 10:03 AM, Dakota  wrote:
>>
>>> The line echo $this->Form->input('username', ['options' => $pUser]);
>>> should be 'user_id'. Also, if the variable is 'users' cakephp will
>>> automatically pick it up as the options for the field.
>>>
>>> Check that your created field allows null with default null.
>>>
>>> --
>>> Like Us on FaceBook https://www.facebook.com/CakePHP
>>> Find us on Twitter http://twitter.com/CakePHP
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "CakePHP" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to cake-php+unsubscr...@googlegroups.com.
>>> To post to this group, send email to cake-php@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/cake-php.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 - Cake not connecting to MySql DB

2014-05-19 Thread Md Bayezid Alam
Thanks a lot everyone, somehow it is working for me..


On Sun, Mar 16, 2014 at 9:38 PM, Leandro Machado Pereira <
llperei...@gmail.com> wrote:

> The error composer timeout, see this:
>
> https://getcomposer.org/doc/04-schema.md#config
>
> http://www.papayasoft.com/2013/08/22/composer-process-timeout-when-fetching-large-repositories/
> Try use *COMPOSER_PROCESS_TIMEOUT=2000 php composer.phar install*
>
>
> 2014-03-16 6:38 GMT-03:00 AD7six :
>
> This doens't look to be CakePHP (version 3 or otherwise) specific.
>>
>>
>> On Saturday, 15 March 2014 17:33:10 UTC+1, Bayezid Alam wrote:
>>>
>>> Hi Jose,
>>>
>>> I did a fresh installation with two ways stated below:
>>>
>>> *From the composer, Do you want to remove the existing VCS (.gif,
>>> .svn..) history? [Y, n]? *with Y and n
>>>
>>> 1st way: For Y, i am getting Vendor's cakephp folder blank after
>>> installation and getting "localhost/cake3" nothing
>>>
>>
>> As shown by the screenshot - the download of cakephp timed out.
>>
>> That's not "Y" specific, not cake3 specific, not cakephp specific, and
>> not even composer specific =). Github or your connection to it was
>> temporarily borken when trying to download cakephp.
>>
>>
>>>
>>> 2nd Way: For n, i am getting vendor's cakephp folder with src & tests
>>> folder after installation which is working good with "localhost/testcake3"
>>> but after a few hours i am getting vendor's cakephp folder blank and
>>> nothing working for "localhost/testcake3" showing blank.
>>>
>>
>> I doubt it =) the screenshot shows the same timeout error.
>>
>> AD
>>
>> --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to cake-php+unsubscr...@googlegroups.com.
>> To post to this group, send email to cake-php@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
>
> http://leandrompereira.com.br
>
> ***Se você pretende redirecionar este e-mail, por favor, apague todos os
> endereços que aparecem nele. Outra dica de segurança é endereçá-lo no Cco.
> Desta forma você estará protegendo a mim, seus amigos e a você mesmo. Eu e
> a Campanha Contra o SPAM agradecemos.Não envie correntes.***
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 - Saving data using Form with HasOne relationship

2014-05-19 Thread Md Bayezid Alam
Thanks a lot, i changed from username to user_id and its working perfectly

but the second one is not working

here is my table structure

*CREATE TABLE IF NOT EXISTS `profiles` (*
*  `id` int(11) NOT NULL AUTO_INCREMENT,*
*  `name` varchar(40) NOT NULL,*
*  `address` varchar(70) NOT NULL,*
*  `email` varchar(30) NOT NULL,*
*  `mobile` varchar(20) NOT NULL,*
*  `user_id` int(11) NOT NULL,*
*  `created` datetime DEFAULT NULL,*
*  `modified` datetime NOT NULL,*
*  PRIMARY KEY (`id`)*
*) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ;*

*Below error is showing:*

*Error: * Call to a member function format() on a non-object
*File* /var/www/html/test3/App/Template/Profiles/index.ctp
*Line: * 22 ( created->format(DATE_RFC850)) ?> )

After removing Format(Date_RFC850)), the data is saving but created field
is entered as NULL.

Thanks again
Bayezid


On Mon, May 19, 2014 at 10:03 AM, Dakota  wrote:

> The line echo $this->Form->input('username', ['options' => $pUser]);
> should be 'user_id'. Also, if the variable is 'users' cakephp will
> automatically pick it up as the options for the field.
>
> Check that your created field allows null with default null.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


3.0 - Saving data using Form with HasOne relationship

2014-05-18 Thread Md Bayezid Alam
Dear All,

I am new & trying from 3.0.

I have made "User" hasOne "Profile" Association with DB

*users [ id, username, password, created, modified ]*
*&*
*profiles [id, name, address, email, mobile, user_id, created, modified]*

In UsersTable.php

*"class UsersTable extends Table{*
*public function initialize(array $config) {*
*$this->hasOne('Profiles',[*
*'className' => 'Profiles',*
*'foreignKey' => 'user_id',*
*'dependent' => true*
*]);*
*$this->displayField('username');*
*}*
*} "*

In ProfilesTable.php

*"class ProfilesTable extends Table{*
*public function initialize(array $config) {*
*$this->belongsTo('Users',[*
*'className' => 'Users',*
*'foreignKey' => 'user_id',*
*'joinType' => 'INNER'*
*]);*
*}*
*} "*

In Entity, User.php & Profile.php

*class User extends Entity{*
*protected $_accessible = ['*' => true];*
*}*

*class Profile extends Entity{*
*protected $_accessible = ['*' => true];*
*}*

In ProfilesController.php's add function,

*public function add(){*

*$profiles = TableRegistry::get('Profiles');*

*$profile = $profiles->newEntity($this->request->data);*

*$pUser = $this->Profiles->Users->find('list',['fields' => ['id',
'username']]);*

*$this->set(compact('pUser'));*

*if($this->request->is('post')){*
*if($profiles->save($profile)){*
*$this->Session->setFlash(__('Profile has been saved.'));*
*return $this->redirect(['action' => 'index']);*
*}*
*$this->Session->setFlash(__('Unable to save profile, please
try again.'));*
*}*
*$this->set(compact('profile'));*
*}*


In Profiles Template, add.ctp

Form->create($profile);
echo $this->Form->input('name');
echo $this->Form->input('email');
echo $this->Form->input('address');
echo $this->Form->input('mobile');
echo $this->Form->input('username', ['options' => $pUser]);
echo $this->Form->button('Save Profile');
echo $this->Form->end();

?>

The question is when i fill up the form and hit the save button *i can not
save the "user_id" of Profiles in Database* and also *can not save the
"created" field as current time.*

I am sure i am missing something, Could you please help me & guide me on
this regard?

Thanks in advance.

Bayezid
Enthusiast Lover of CakePHP

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 - How to print/debug from Controller like Cake 2.xx

2014-04-30 Thread Md Bayezid Alam
debug is set to true by default. i did var_dump but nothing happens.


On Thu, May 1, 2014 at 12:37 AM, José Lorenzo  wrote:

> Do you have debug set to `true` in app.php? What happens if you use
> var_dump instead?
>
>
> On Wednesday, April 30, 2014 8:00:29 PM UTC+2, Bayezid Alam wrote:
>>
>> I tried by pr/debug($this->request->data); pr/debug($article) but
>> showing nothing
>>
>>
>> On Wed, Apr 30, 2014 at 11:51 PM, Md Bayezid Alam 
>> wrote:
>>
>>> i tried but It's showing nothing.. Could you please let me know how can
>>> i get this? Thanks
>>>
>>>
>>> On Wed, Apr 30, 2014 at 11:24 PM, euromark wrote:
>>>
>>>> And what is your problem?
>>>> The function still exists and can be used the same way.
>>>>
>>>>
>>>> Am Mittwoch, 30. April 2014 16:27:00 UTC+2 schrieb Bayezid Alam:
>>>>
>>>>> Dear All,
>>>>>
>>>>> Is there any way to print from Controller?
>>>>>
>>>>> For example,
>>>>>
>>>>> I have a form like
>>>>>
>>>>> >>>> echo $this->Form->create($article);
>>>>> echo $this->Form->input('title');
>>>>> echo $this->Form->input('body', ['rows' => '3']);
>>>>> echo $this->Form->button(__('Save Articles'));
>>>>> echo $this->Form->end();
>>>>> ?>
>>>>>
>>>>> I have function in controller
>>>>>
>>>>> public function add(){
>>>>> $article = $this->Articles->newEntity($this->request->data);
>>>>> if($this->request->is('post')){
>>>>> if($this->Articles->save($article)){
>>>>> $this->Session->setFlash(__('Your article has been
>>>>> saved.'));
>>>>> return $this->redirect(['action' => 'index']);
>>>>> }
>>>>> $this->Session->setFlash(__('Unable to add your
>>>>> article.'));
>>>>>  }
>>>>>
>>>>> $this->set(compact('article'));
>>>>> }
>>>>>
>>>>> I want to check by printing via pr() /  dubug() from my add function
>>>>> like i can do from Cakephp 2.xx.
>>>>>
>>>>  --
>>>> Like Us on FaceBook https://www.facebook.com/CakePHP
>>>> Find us on Twitter http://twitter.com/CakePHP
>>>>
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "CakePHP" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to cake-php+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to cake-php@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/cake-php.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 - How to print/debug from Controller like Cake 2.xx

2014-04-30 Thread Md Bayezid Alam
I tried by pr/debug($this->request->data); pr/debug($article) but showing
nothing


On Wed, Apr 30, 2014 at 11:51 PM, Md Bayezid Alam wrote:

> i tried but It's showing nothing.. Could you please let me know how can i
> get this? Thanks
>
>
> On Wed, Apr 30, 2014 at 11:24 PM, euromark  wrote:
>
>> And what is your problem?
>> The function still exists and can be used the same way.
>>
>>
>> Am Mittwoch, 30. April 2014 16:27:00 UTC+2 schrieb Bayezid Alam:
>>
>>> Dear All,
>>>
>>> Is there any way to print from Controller?
>>>
>>> For example,
>>>
>>> I have a form like
>>>
>>> >> echo $this->Form->create($article);
>>> echo $this->Form->input('title');
>>> echo $this->Form->input('body', ['rows' => '3']);
>>> echo $this->Form->button(__('Save Articles'));
>>> echo $this->Form->end();
>>> ?>
>>>
>>> I have function in controller
>>>
>>> public function add(){
>>> $article = $this->Articles->newEntity($this->request->data);
>>> if($this->request->is('post')){
>>> if($this->Articles->save($article)){
>>> $this->Session->setFlash(__('Your article has been
>>> saved.'));
>>> return $this->redirect(['action' => 'index']);
>>> }
>>> $this->Session->setFlash(__('Unable to add your article.'));
>>>  }
>>>
>>> $this->set(compact('article'));
>>> }
>>>
>>> I want to check by printing via pr() /  dubug() from my add function
>>> like i can do from Cakephp 2.xx.
>>>
>>  --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to cake-php+unsubscr...@googlegroups.com.
>> To post to this group, send email to cake-php@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 - How to print/debug from Controller like Cake 2.xx

2014-04-30 Thread Md Bayezid Alam
i tried but It's showing nothing.. Could you please let me know how can i
get this? Thanks


On Wed, Apr 30, 2014 at 11:24 PM, euromark  wrote:

> And what is your problem?
> The function still exists and can be used the same way.
>
>
> Am Mittwoch, 30. April 2014 16:27:00 UTC+2 schrieb Bayezid Alam:
>
>> Dear All,
>>
>> Is there any way to print from Controller?
>>
>> For example,
>>
>> I have a form like
>>
>> > echo $this->Form->create($article);
>> echo $this->Form->input('title');
>> echo $this->Form->input('body', ['rows' => '3']);
>> echo $this->Form->button(__('Save Articles'));
>> echo $this->Form->end();
>> ?>
>>
>> I have function in controller
>>
>> public function add(){
>> $article = $this->Articles->newEntity($this->request->data);
>> if($this->request->is('post')){
>> if($this->Articles->save($article)){
>> $this->Session->setFlash(__('Your article has been
>> saved.'));
>> return $this->redirect(['action' => 'index']);
>> }
>> $this->Session->setFlash(__('Unable to add your article.'));
>> }
>>
>> $this->set(compact('article'));
>> }
>>
>> I want to check by printing via pr() /  dubug() from my add function like
>> i can do from Cakephp 2.xx.
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


3.0 - How to print/debug from Controller like Cake 2.xx

2014-04-30 Thread Md Bayezid Alam
Dear All,

Is there any way to print from Controller?

For example,

I have a form like

Form->create($article);
echo $this->Form->input('title');
echo $this->Form->input('body', ['rows' => '3']);
echo $this->Form->button(__('Save Articles'));
echo $this->Form->end();
?>

I have function in controller

public function add(){
$article = $this->Articles->newEntity($this->request->data);
if($this->request->is('post')){
if($this->Articles->save($article)){
$this->Session->setFlash(__('Your article has been
saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Session->setFlash(__('Unable to add your article.'));
}

$this->set(compact('article'));
}

I want to check by printing via pr() /  dubug() from my add function like i
can do from Cakephp 2.xx.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 - Cake not connecting to MySql DB

2014-03-04 Thread Md Bayezid Alam
after updating, Its not working, i may missing anything.

'Datasources' => [
'default' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'loginname',
'password' => 'password',
'database' => 'cake3_db',
'prefix' => false,
'encoding' => 'utf8',
],

/**
 * The test connection is used during the test suite.
 */
'test' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'my_app',
'password' => 'secret',
'database' => 'test_myapp',
'prefix' => false,
'encoding' => 'utf8',
],
],


*after executing pr(), getting below msg*

Cake\ORM\Query Object
(
[_hasFields:protected] =>
[_useBufferedResults:protected] => 1
[_hydrate:protected] => 1
[_counter:protected] =>
[_eagerLoader:protected] =>
[_connection:protected] => Cake\Database\Connection Object
(
[_config:protected] => Array
(
[driver] => Cake\Database\Driver\Mysql
[persistent] =>
[host] => localhost
[login] => loginname
[password] => password
[database] => cake3_db
[prefix] =>
[encoding] => utf8
[name] => default
)

[_driver:protected] => Cake\Database\Driver\Mysql Object
(
[_baseConfig:protected] => Array
(
[persistent] => 1
[host] => localhost
[login] => loginname
[password] =>
[database] => cake
[port] => 3306
[flags] => Array
(
)

[encoding] => utf8
[timezone] =>
[init] => Array
(
)

[dsn] =>
)

[_config:protected] => Array
(
[driver] => Cake\Database\Driver\Mysql
[persistent] =>
[host] => localhost
[login] => loginname
[password] => password
[database] => cake3_db
[prefix] =>
[encoding] => utf8
[name] => default
[port] => 3306
[flags] => Array
(
)

[timezone] =>
[init] => Array
(
)

[dsn] =>
)

[_autoQuoting:protected] =>
[_startQuote:protected] => `
[_endQuote:protected] => `
[_schemaDialect:protected] =>
Cake\Database\Schema\MysqlSchema Object
(
[_driver:protected] =>
Cake\Database\Driver\Mysql Object
 *RECURSION*
)

[_connection:protected] => PDO Object
(
)

)

[_transactionLevel:protected] => 0
[_transactionStarted:protected] =>
[_useSavePoints:protected] =>
[_logQueries:protected] =>
[_logger:protected] =>
)

[_type:protected] => select
[_parts:protected] => Array
(
[delete] => 1
[update] => Array
(
)

[set] => Array
(
)

[insert] => Array
(
)

[values] => Array
(
)

[select] => Array
(
)

[distinct] =>
[modifier] => Array
(
)

[from] => Array
(
)

[join] => Array
(
)

[where] =>
[group] => Array
(
)

[having] =>
[order] =>
[limit] =>
[offset] =>
[union] => Array
(
)

[epilog] =>
)

[_templates:protected] => Array
(
[delete] => DELETE
[update] => UPDATE %s
[where] =>  WHERE %s
[group] =>  GROUP BY %s
  

Conditional Model Query

2012-12-09 Thread Md
Hi there,

I have a small application that has three tables.  users, roles, and 
role_users.  The role_users table is a join table as a user can have 
multiple roles.   In my UsersController class I am trying to get a count 
for the number of roles the current user has where there is a enduserid = 
1.   

public function hasEndUser(){

$this->loadModel('RoleUser');

$userId = $this->Auth->user('id'); 

$conditions = array('RoleUser.user_id ='=>$userId,'RoleUser.enduserid 
='=>1);

$result = $this->RoleUser->find('count',$conditions);

debug($result);

 }

For whatever reason, *this is the SQL that I am getting back:*

SELECT COUNT(*) AS `count` FROM `bridges`.`role_users` AS `RoleUser` LEFT 
JOIN `bridges`.`users` AS `User` ON (`RoleUser`.`user_id` = `User`.`id`) 
LEFT JOIN `bridges`.`roles` AS `Role` ON (`RoleUser`.`role_id` = 
`Role`.`id`) WHERE 1 = 1


As a result, I am also getting the wrong count.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Trouble with model associations and query.

2012-12-09 Thread Md
I am having trouble returning a query.  I have the following setup

Users - users class of all users in the system.
Roles - roles class with a set of available roles.  E.g. teacher, student, 
tutor
RoleUsers - a mapping table between users and roles as a single user can 
have multiple roles.


My Users class has this

public $hasAndBelongsToMany = array(

'Role' =>

array(

'className'  => 'Role',

'joinTable'  => 'role_users',  //was roles_users

'foreignKey' => 'user_id',

'associationForeignKey'  => 'role_id',

'unique' => true)

);


My RolesUser class has this

public $belongsTo = array(

'User' =>

array(

'className'  => 'User',

'joinTable'  => 'users',  

'foreignKey' => 'user_id',

'unique' => true),

 'Role' =>

array(

'className'  => 'Role',

'joinTable'  => 'roles',  

'foreignKey' => 'role_id',

'unique' => true)


I am now trying to query the user table to determine the students belonging 
to the logged in user (a teacher or tutor)


public function getStudents(){

$userId = $this->Auth->user('id'); 

$conditions = array('conditions' => array (array('Role.id =' => 75),  //75 
is the role for all students

array ('RoleUser.id = ' => $userId)));  //this is the current logged in user

$result = $this->User->find('all',$conditions);

debug($result);


In the top of my UsersController, I have:

public $uses = array('Role', 'RoleUser');


When I run the function getStudents above, I am getting *Error: *Call to a 
member function find() on a non-object


);

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Just Register and earn money

2010-12-05 Thread Md Moniruzzaman
Hi Dear

Just Click this Link and Register. After than Click The VIew Ads and view
the ads and Earn Money. Its just a Handsome cash for you.
Really its a Hand some cash.
Here is the link :
 *
http://www.adserviceptc.com/index.php?ref=shimul27*

-- 
Regards
Md.Moniruzzaman

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


How to use CMS in cake php.

2010-02-01 Thread Md Moniruzzaman
How to use CMS in cake php.
I want to whole site content control in cake php admin panel.

Can you help me?

-- 
Regards
Md.Moniruzzaman
Web Developer
Contact no:+088-01712027826
United Group International

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en