Monday, August 31, 2015

How to use custom helper in Controller. CakePHP 3 only.

Hi,

Previously in CakePHP 2 we are using our custom helper in controller like below.

App::import('Helper', 'Adminright');
$this->View   = new View($this->Controller);
$this->adminright = new AdminrightHelper($this->View);

But when we tried to migrate to CakePHP 3, we cannot able to figured out that how to use helper in Controller.

Can someone please help on this ASAP.

Thanks,
Jitendra

--
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+unsubscribe@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: Compare 2 date in cake3

Maybe something like:

                'compare' => [
                    'rule' => function ($value, $context) {
                        return $value->gte($context['data']['start_date']);
                    }

Le 31 août 2015 18:24, "lorenzoshake" <ferri.lorenzo@gmail.com> a écrit :
I've been tried with:

        $validator ->add('end_date', [
            'valid'=> ['rule' => 'date'] ,
            'compare' =>['rule' => ['comparison', '>' ,'start_date']]
             ]
            );

but doesn't work;

how to validate start_date and end_date ( end must be greater than start_date) ?

--
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+unsubscribe@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+unsubscribe@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: Compare 2 date in cake3

You can do like this.

->add('end_date', [
                'mustValid'=>[
                    'rule'=>'checkForEndDate',
                    'provider'=>'table',
                    'message'=>__('End date should be greater than start date')
                ]
            ])

and define following function in model table (in same class)

public function checkForEndDate($value, $context) {
       if(!empty($value) && !empty($context['data']['start_date'])) {
// may be you need to play with time object to compare dates
            if($value <= $context['data']['start_date']) {
                return false;
            }
        }
        return true;
    }

On Mon, Aug 31, 2015 at 9:53 PM, lorenzoshake <ferri.lorenzo@gmail.com> wrote:
I've been tried with:

        $validator ->add('end_date', [
            'valid'=> ['rule' => 'date'] ,
            'compare' =>['rule' => ['comparison', '>' ,'start_date']]
             ]
            );

but doesn't work;

how to validate start_date and end_date ( end must be greater than start_date) ?

--
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+unsubscribe@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.



--
Chetan Varshney
Ektanjali Softwares Pvt Ltd

--
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+unsubscribe@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.

Compare 2 date in cake3

I've been tried with:

        $validator ->add('end_date', [
            'valid'=> ['rule' => 'date'] ,
            'compare' =>['rule' => ['comparison', '>' ,'start_date']]
             ]
            );

but doesn't work;

how to validate start_date and end_date ( end must be greater than start_date) ?

--
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+unsubscribe@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 Fake Seeder Plugin

Today I released the initial version of my fresh out of the oven CakePHP (2.x) Fake Seeder plugin.


https://github.com/ravage84/cakephp-fake-seeder


"A CakePHP shell to seed your database with fake and/or fixed data."


I would love to hear some feedback from the community.


Enjoy the baking!

Marc



--
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+unsubscribe@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.

Sunday, August 30, 2015

How to upload images on cakephp3

Can anybody please help me uploading images in cakephp3, example




--
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+unsubscribe@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.

Saturday, August 29, 2015

CakePHP 3.1.0-RC1 Released.

The CakePHP core team is happy to announce the immediate availability of CakePHP 3.1.0-RC1. This release is the first release candidate for the 3.1 branch which adds several new features to the 3.x series. We would appreciate any feedback
you might have on the new features before their API definitions become stable.

Changes Since 3.1.0-beta
------------------------

There have been several changes to 3.1 through feedback on the beta releases. The following aspects have changed since the beta releases:

* `Controller::getView()` has been removed. In its place `viewBuilder()` has been added. This method and new builder class resolves the issues that were caused by creating view instances eagerly.
* Mailer instances now set their template names based on the action that was invoked.
* `View::viewPath()` is now `View::templatePath()`.
* `Auth.redirect` is no longer to referrer URL when accessing login action. Instead it is only set to a protected URL when trying to access it without authentication, before redirecting to login action.

Additional Features
-------------------

* `Validation::latitude()`, and `Validation::longitude()` were added.
* `Validation::ascii()`, `Validation::utf8()`, and `Validation::isInteger()` were added.
* `Cache::add()` was ported from 2.x. This method allows you to atomically add data to a cache backend if the key did not already exist.
* `Time::listTimezones()` now supports options to display timezone abbreviations.
* `Hash::get()` now supports objects implementing ArrayAccess.
* `Hash::sort()` supports case-insensitive sorting through a new `ignoreCase` option.

Unless there are major issues with the 3.1.0-RC release, we will have a stable release packaged in the 2-3 weeks. The [3.1 migration guide](http://book.cakephp.org/3.0/en/appendices/3-1-migration-guide.html) has a full list of all the changes in 3.1.0 and is recommended reading for those considering upgrading.

As always, a huge thanks to all the community members that helped make this release happen by reporting issues and sending pull requests.

Download a [packaged release on github](https://github.com/cakephp/cakephp/releases).

--
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+unsubscribe@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.

Friday, August 28, 2015

Re: Cake 1.3 custom pagination

Kuroi, Can you share your solution once again. As I am facing same sort of problem currently.

On Monday, 5 December 2011 12:08:32 UTC, KuroiNeko wrote:
oops. i forgot another one example

http://pastebin.com/R6VqKnS6

--
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+unsubscribe@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.

When Fat Models become too Fat?

Hi All

I have always stuck to skinny controllers, fat models, but in some projects, I have noticed my model files are now over 5000 lines long!!

I would love to break the code up more so that it isn't all in the main model files.

Has anyone given this any thought of a good way to achieve this?

I thought about breaking some code into Components, so that I am not interacting directly with the model files, however I would be concerned about Unit Testing in this case.

Can anyone offer any insights?

PS - this is in reference to CakePHP 2 - I don't know if this has been tackled further in CakePHP 3?

Thanks
Michael

--
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+unsubscribe@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.

Wednesday, August 26, 2015

Re: Crud View pluging and related model fields

I would use the 'category_id' field with a custom formatter that would display the category description. Currently there is no support for using dot notation for fields that need to appear in a pagination table

On Tuesday, August 25, 2015 at 1:43:14 PM UTC+2, HK wrote:
I started using crud-view plugin https://github.com/FriendsOfCake/crud-view

I have searched but cannot find answer to my problem. In index action I am listing all my fields I want to have:

$action->config('scaffold.fields', [
            'category.description' => ['title' => 'Κατηγορία'],
            'date' => [
                'title' => 'Ημε/νια',
                'formatter' => function ($name, $value, $entity) {
                    return $value->format('Y-m-d');
                }
            ],
            'description' => ['title' => 'Περιγραφή'],
            'url' => ['title' => 'Σύνδεσμος']
        ]);


category is a related model of the current model. The current model is Actions and belongsTo Categories.

I can see that crud plugin loads my Actions with categories being contained in the resultSet. But how can I change how the appear on Paginator?

Thanks

--
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+unsubscribe@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.

Tuesday, August 25, 2015

Upload e tratamento de imagens com cake 3.x

Bom dia a todos,

alguém poderia me indicar um tutorial para realizar upload e redimensionamento de imagem com o cake 3.x? 

desde já agradeço!

--
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+unsubscribe@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: HABTM example for CakeDC Search plugin

Sorry for digging this up but as we all know history repeats itself ;-)

I have the same error that tells me that the latter model in a HABTM relation is not associated with the relation-table. I wonder if you could resolve this issue? 

Am Dienstag, 20. Dezember 2011 16:23:45 UTC+1 schrieb desig...@gmail.com:
This is what I have currently:

    var $filterArgs = array(
        array('name' => 'filter', 'type' => 'query', 'method' =>
'orConditions'),
        array('name' => 'filter', 'type' => 'subquery', 'method' =>
'findByTags', 'field' => 'NewsPost.id'),
    );

        public function findByTags($data = array()) {
                $this->NewsPostsNewsTag->Behaviors->attach('Containable',
array('autoFields' => false));
                $this->NewsPostsNewsTag->Behaviors->attach('Search.Searchable');
                $query = $this->NewsPostsNewsTag->getQuery('all', array(
                        'conditions' => array('NewsTag.name'  => $data['filter']),
                        'fields' => array('news_post_id'),
                        'contain' => array('NewsTag')
                ));
                return $query;
        }

But I'm now getting:

Warning (512): Model "NewsPostsNewsTag" is not associated with model
"NewsTag" [CORE\cake\libs\model\behaviors\containable.php, line 343]

Which is strange, as I wasn't getting that error before?

TIA,

d//t

On Dec 20, 3:13 pm, "designv...@gmail.com" <designv...@gmail.com>
wrote:
> Yep! Sure did!
>
> I was fairly sure I had followed everything correctly, but I kept
> getting "Operand should contain 1 column" error?
>
> I looked at debug and the 'tags' portion of the query was returning
> all the fields not just the id's?
>
> I think it's something to do with containable, but I couldn't figure
> it out at all!
>
> d//t
>
> On Dec 20, 2:50 pm, José Lorenzo <jose....@gmail.com> wrote:
>
>
>
>
>
>
>
> > Did you read this?
>
> >http://cakedc.com/downloads/view/cakephp_search_plugin

--
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+unsubscribe@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.

Crud View pluging and related model fields

I started using crud-view plugin https://github.com/FriendsOfCake/crud-view

I have searched but cannot find answer to my problem. In index action I am listing all my fields I want to have:

$action->config('scaffold.fields', [
            'category.description' => ['title' => 'Κατηγορία'],
            'date' => [
                'title' => 'Ημε/νια',
                'formatter' => function ($name, $value, $entity) {
                    return $value->format('Y-m-d');
                }
            ],
            'description' => ['title' => 'Περιγραφή'],
            'url' => ['title' => 'Σύνδεσμος']
        ]);


category is a related model of the current model. The current model is Actions and belongsTo Categories.

I can see that crud plugin loads my Actions with categories being contained in the resultSet. But how can I change how the appear on Paginator?

Thanks

--
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+unsubscribe@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 mock a controller

i recommend you to look up on cakephp book and on stack overflow: http://stackoverflow.com/questions/11152128/cakephp-2-how-to-create-a-mock-in-a-model-test-case

On Saturday, August 22, 2015 at 4:14:51 AM UTC+2, Franck Ngako wrote:
Hi,
I've been giving a try on cakepphp for 2 months now !
And i'm facing an issue "how to mock a method"
Please help me get out of this  matter !
TY !

--
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+unsubscribe@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.

Monday, August 24, 2015

Re: Check user status fails

Did you find a solution to your status problem?

If not, please provide more information - like when are you testing for the status value? During login or?
Are you testing with a user that you know has the expected status in the database? Does the website show the same value?

Enjoy, John

On Thursday, 13 August 2015 11:37:31 UTC+3, Gerculy Robert wrote:
Hi, 
I'm trying to set some groups for user status :
0 - pending activation 
1 - user activated 
2 - temporary banned
3 - permanently banned  - not added in examaple 

My problem is no matter what I do, status 2 shows up

$status_user = $this->Session->read('Auth.User.status');
if($status_user == 0){
$this->Session->setFlash(__('You\'ve been logged out 0.'));
$this->redirect($this->Auth->logout());
} else if($status_user == 2){
$this->Session->setFlash(__('You\'ve been logged out 2.'));
$this->redirect($this->Auth->logout());
}else{
$this->Session->setFlash(__('Welcome '. $this->Auth->user('username')));
                        $this->redirect($this->Auth->redirectUrl());
//header('Location: dashboard');
}

I tried with switch case, same issue. It's been one hour running around without finding the problem,
I echo $status_user and surprise , it returned 1, which would redirect the user to dashboard.
If it's 0, returns, 0 if 1 or 2 returns 2 . 

--
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+unsubscribe@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.

Authentication with multiple tables (using myAuthComponent) doesn't work in Cakephp 3.0

Hello Everyone,

Since i've started my project from the analysis and not from coding, i came to diagram models with 3 tables that need an authentication.
For these reason i don't want to use one 'users' table, but 3 of them: 'clients', 'administrators' and 'employers'.

I tried to follow the solution with myAuthComponent (which extends basic AuthComponent) of this post on stack overflow http://stackoverflow.com/questions/2973620/cakephp-auth-with-multiple-users-tables

So..
-i implemented the AppController.php by loading myAuthComponent omitting the 'usermodel'
-i created the login.ctp under the 'Pages' folder, it has a dropdown to make the selection of the model
-this is the login function on the PagesController.php:

public function login()
   
{
       
if ($this->request->is('post')) {
           
if($this->request->data['type'] == NULL){
                $this
->Flash->error(__('Login Failed. Please, choose one type of user and try again.'));
               
return;
           
}
           
            $user
= $this->AppAuth->identify($this->request);
            debug
("i don't reach this");
           
/* if ($client) {
                $this->Auth->setUser($client);
                $this->Flash->success(__('Welcome on ArchiGest'));
                return $this->redirect(['controller' => 'Exams', 'action' => 'index']);
            }
            else if ($client) {
                $this->Auth->setUser($client);
                $this->Flash->success(__('Welcome on ArchiGest'));
                return $this->redirect(['controller' => 'Exams', 'action' => 'index']);
            }
            else if ($client) {
                $this->Auth->setUser($client);
                $this->Flash->success(__('Welcome on ArchiGest'));
                return $this->redirect(['controller' => 'Exams', 'action' => 'index']);
            }
            $this->Flash->error(__('Invalid username or password, try again'));*/

       
}
   
}      


and this is MyAuthComponent.php:

<?php
namespace App\Controller\Component;

use Cake\Core\App;
use Cake\Controller\Component;
use Cake\Controller\Component\AuthComponent;

//App::import('Component', 'AuthComponent');
class AppAuthComponent extends AuthComponent {

   
function identify($user = null, $conditions = null) {
       
       
if($user->data["type"] == 0){
           
            $this
->userModel = "Client";
            $this
->_config["authenticate"]["Form"]["userModel"] = "Client";
            debug
($this);
            debug
($this->_config);
            $result
= parent::identify($user, $conditions); // let cake do it's thing
           
if ($result) {
                debug
("don't reach this");
               
return $result; // login success
           
}
       
}
       
else if($user->data["type"] == 1){
            $this
->userModel = "Employer";
            $result
= parent::identify($user, $conditions); // let cake do it's thing
           
if ($result) {
               
return $result; // login success
           
}
       
}
       
else if($user->data["type"] == 2){
            $this
->userModel = "Administrator";
            $result
= parent::identify($user, $conditions); // let cake do it's thing
           
if ($result) {
               
return $result; // login success
           
}
       
}
       
return null; // login failure
   
}
}


I got stuck on changing the usermodel from 'users' to 'clients', 'administrators' or 'employers' on-the-fly by having this error: "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'archigest.users' doesn't exist".

Can someone please free this poor student from the swamp?

thanks in advance

--
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+unsubscribe@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.

Sunday, August 23, 2015

Mathematical equations

Hello everyone
Is there any plugin to display mathatical equations like derivatives,
Logarithmic equations, limiting equations and so on for cakephp?

If anyone here knows howto i wud be greatful

Thanks

--
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+unsubscribe@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 use association with TableRegistry in cakephp 3

As you can see in 1st Business\Model\Entity\Business Object there is category association present, when called in BusinessController, But It's missing, when called in CategoriesController using TableRegistry. 
why that ? any idea how to get this fixed ? I called called below in BusinessesController

$this->autoRender = false;
        $this
->paginate = [
           
'contain' => ['Cities', 'Categories' ]
       
];
       
foreach( $this->paginate( $this->Businesses ) as $business ) {
            pr
( $business );
       
}

I got this results

Business\Model\Entity\Business Object
(
   
[id] => 1
   
[city_id] => 414
   
[postal_id] => 780299
   
[slug] => coatings-2000-lloydminster-ab-ca-1
   
[business_name] => Coatings 2000
   
[street_address] => 2B Production Ave
   
[address_locality] => Lloydminster
   
[address_region] => AB
   
[postal_code] => T9V 0Y4
   
[last_modified] => Cake\I18n\Time Object
       
(
           
[time] => 2015-03-12T00:00:00+0530
           
[timezone] => Asia/Calcutta
           
[fixedNowTime] =>
       
)


   
[status] => 1
   
[categories] => Array
       
(
           
[0] => Business\Model\Entity\Category Object
               
(
                   
[id] => 2276
                   
[parent_id] => 2212
                   
[category_slug] => protective-coatings
                   
[category_name] => Protective Coatings
                   
[lft] => 4449
                   
[rght] => 4450
                   
[level] => 2
                   
[_joinData] => Cake\ORM\Entity Object
                       
(
                           
[category_id] => 2276
                           
[business_id] => 1
                           
[[new]] =>
                           
[[accessible]] => Array
                               
(
                                   
[*] => 1
                               
)


                           
[[dirty]] => Array
                               
(
                               
)


                           
[[original]] => Array
                               
(
                               
)


                           
[[virtual]] => Array
                               
(
                               
)


                           
[[errors]] => Array
                               
(
                               
)


                           
[[repository]] => BusinessesCategories
                       
)


                   
[[new]] =>
                   
[[accessible]] => Array
                       
(
                           
[*] => 1
                       
)


                   
[[dirty]] => Array
                       
(
                       
)


                   
[[original]] => Array
                       
(
                       
)


                   
[[virtual]] => Array
                       
(
                       
)


                   
[[errors]] => Array
                       
(
                       
)


                   
[[repository]] => Business.Categories
               
)


       
)


   
[city] => Business\Model\Entity\City Object
       
(
           
[id] => 414
           
[city_slug] => lloydminster
           
[city_name] => Lloydminster
           
[[new]] =>
           
[[accessible]] => Array
               
(
                   
[*] => 1
               
)


           
[[dirty]] => Array
               
(
               
)


           
[[original]] => Array
               
(
               
)


           
[[virtual]] => Array
               
(
               
)


           
[[errors]] => Array
               
(
               
)


           
[[repository]] => Business.Cities
       
)


   
[[new]] =>
   
[[accessible]] => Array
       
(
           
[*] => 1
       
)


   
[[dirty]] => Array
       
(
       
)


   
[[original]] => Array
       
(
       
)


   
[[virtual]] => Array
       
(
       
)


   
[[errors]] => Array
       
(
       
)


   
[[repository]] => Business.Businesses
)

when i called this in categories controller, it shows missing category associations

$this->autoRender = false;
        $this
->paginate = [
           
'contain' => ['Cities', 'Categories' ]
       
];
        $businessTable
= \Cake\ORM\TableRegistry::get( 'Business.Businesses' );
       
foreach( $this->paginate( $businessTable ) as $business ) {
            pr
( $business );
       
}
I got this results with missing categories associations
Business\Model\Entity\Business Object
(
   
[id] => 1
   
[city_id] => 414
   
[postal_id] => 780299
   
[slug] => coatings-2000-lloydminster-ab-ca-1
   
[business_name] => Coatings 2000
   
[street_address] => 2B Production Ave
   
[address_locality] => Lloydminster
   
[address_region] => AB
   
[postal_code] => T9V 0Y4
   
[last_modified] => Cake\I18n\Time Object
       
(
           
[time] => 2015-03-12T00:00:00+0530
           
[timezone] => Asia/Calcutta
           
[fixedNowTime] =>
       
)


   
[status] => 1
   
[categories] => Array
       
(
       
)


   
[city] => Business\Model\Entity\City Object
       
(
           
[id] => 1
           
[city_slug] => albany
           
[city_name] => Albany
           
[[new]] =>
           
[[accessible]] => Array
               
(
                   
[*] => 1
               
)


           
[[dirty]] => Array
               
(
               
)


           
[[original]] => Array
               
(
               
)


           
[[virtual]] => Array
               
(
               
)


           
[[errors]] => Array
               
(
               
)


           
[[repository]] => Business.Cities
       
)


   
[[new]] =>
   
[[accessible]] => Array
       
(
           
[*] => 1
       
)


   
[[dirty]] => Array
       
(
       
)


   
[[original]] => Array
       
(
       
)


   
[[virtual]] => Array
       
(
       
)


   
[[errors]] => Array
       
(
       
)


   
[[repository]] => Business.Businesses
)

--
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+unsubscribe@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.