|
Posted by mejpark on 08/13/07 12:28
On Aug 13, 12:53 pm, Ulf Kadner <dr_lo...@gmx.net> wrote:
> mejpark wrote:
> > Morning,
>
> Good? :-x
>
> > <?php
> > class Dealer extends AppModel
> > {
> > var $name = 'Dealer';
> > var $hasMany = array ('Product' => array(
> > 'className' => 'Product',
> > 'conditions'=>,
> > 'order'=>,
>
> you forget do define the value, assigned to array keys 'conditions' and
> 'order'
>
> > Eclipse produces an error underneath the comma directly after the
> > 'conditions' field, which says:
> > "Parse error: "Static/scalar constant expected.""
>
> thats it, yes
>
> > <?php
> > class Dealer extends AppModel
> > {
> > var $name = 'Dealer';
> > var $hasMany = array (
> > "Product" =>
> > array("className","Product","conditions","order","foreignKey","dealer_id"));
>
> Its usually not the same.
> You are using now a numeric indicated array and not the required
> associative array format.
>
> You must read the documentation about arrays for understanding:http://www.php.net/manual/en/language.types.array.php
>
> > What is the difference between " => " and " -> " in PHP?
>
> => is only usable in array context. (see Array-Doc)
>
> -> is to call some class sensitive Elements (e.g. Methods, Fields)
> access only non static Elements
>
> for accessing static class elements use the double colon ::
>
> So Long. Ulf
Thanks for that Ulf, very helpful response!
Until next time >>
[Back to original message]
|