My 'Slider'-plugin 'SliderSlide'-model is connected with the main
'User'-model but retrieving data through my plugin 'SliderSlide'-model
doesn't give me any $sliderSlide['User'] array.

Models are connected like this:
/app/Plugin/Slider/Model/SliderSlide.php
        public $belongsTo = array(
                'User' => array(
                        'className' => 'User',
                        'foreignKey' => 'user_id'
                )
        );

/app/Model/User.php
        public $hasMany = array(
                ...
                'Slider.SliderSlide' => array(
                        'className' => 'SliderSlide',
                        'foreignKey' => 'user_id'
                )

The controller function is:
        public function admin_view($id = null) {
                $this->SliderSlide->id = $id;
                if (!$this->SliderSlide->exists()) {
                        throw new NotFoundException();
                }
                $this->set('sliderSlide', $this->SliderSlide->read(null, $id));
        }

And gives me:
array(
        'SliderSlide' => array(
                'id' => '1',
                'listing' => '0',
                'user_id' => '1',
                'title' => '',
                'description' => 'Omschrijving',
                'created' => '2012-04-24 22:33:58',
                'modified' => '2012-05-17 11:36:58',
                'publish' => '1',
                'publishFrom' => '2013-01-01 00:00:00',
                'publishTill' => '2013-01-01 00:00:00',
                'foreign_plugin' => null,
                'foreign_model' => '',
                'foreign_controller' => '',
                'foreign_id' => null
        )
)

but I'm missing
        'User' => array(...)

Can anyone tell me how to solve this?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to