我有用户和数字板。 他们彼此有现金转拨。 如果没有任何用户数据,我怎么能够检索所有用户仪表板?
我试图这样做,但同时也回到了用户模式:
$this->User->id = $this->Auth->user( id );
$this->User->find( all , array( contain => Dashboard ));
我有用户和数字板。 他们彼此有现金转拨。 如果没有任何用户数据,我怎么能够检索所有用户仪表板?
我试图这样做,但同时也回到了用户模式:
$this->User->id = $this->Auth->user( id );
$this->User->find( all , array( contain => Dashboard ));
您可以提出<代码><>fields的备选办法,以便你只收回id场,而没有找回。 (你可能把它搁置起来,根本没有任何领域。)
$this->User->find(
all ,
array(
contain => Dashboard ,
fields => User.id
)
);
Use the Dashboard model instead with a condition for the user id:
$this->User->Dashboard->bindModel(array( hasMany => array( DashboardsUsers )));
$this->User->Dashboard->find( all , array(
conditions => array( User.id => $this->Auth->user( id )),
recursive => -1
));
我认为,这项工作应当:
In CakePHP, it seems like a lot of functions can take their arguments as nested, multidimensional arrays, or as dotted strings: $this->MyModel->contain(array( Something , Something.Else , ...
I ve got a cakephp app that I m trying to get to serve up the Pages::404 function (and corresponding view) whenever Cake encounters any error (missing controller, action, etc). What s the best way to ...
I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...
I am wondering if there is a way to specify the date format in the forms created using CakePHP s $form->inputs(); Please note that this is not the individual $form->input() but instead $form->inputs() ...
I am writing a CakePHP 1.2 app. I have a list of people that I want the user to be able to filter on different fields. For each filterable field, I have a drop down list. Choose the filter ...
In my CakePHP app, I m pulling in the results of a table called Timesheets . This table has an athlete_id and a few split times for a race. I need to do some calculations on one athlete s times ...
How would I represent the following in a CakePHP model? Product ======= product_id .... Cart ==== cart_id .... Carts_Products ============== cart_id product_id quantity
I am a beginning Cake user and trying to do some work on an already existing application. Running into a problem when I create a new controller. I have created StoreController and when I try to call ...