Re: BelongsToMany model

2014-09-01 Thread Abdelmajid el Ibrahimi
i just changed the key to leerlingen_id and it works. Just a workaround but 
i dont want to screw with the core files. CakePHP is supposed to be easy to 
use that means that if i follow the tutorial it should do what is says.

Op zondag 31 augustus 2014 21:35:59 UTC+2 schreef José Lorenzo:

 You also have control over what is the foreignKey to use when creating the 
 association. Refer the the ORM docs to customize what the query builder is 
 doing.

 On Sunday, August 31, 2014 7:30:36 PM UTC+2, Abdelmajid el Ibrahimi wrote:

 But even if i take that out it still says the same.

 Op zondag 31 augustus 2014 11:45:25 UTC+2 schreef José Lorenzo:

 There is no public $primaryKey in CakePHP 3.0

 You may use $this-primaryKey($myKey) inside the initialize() method

 On Sunday, August 31, 2014 3:54:56 AM UTC+2, Abdelmajid el Ibrahimi 
 wrote:

 I have made two tables leerlingen and verzorgers. Because these have a 
 many to many relation i added a table leerlingen_verzorgers.
 I have added 3 model tables:

 class VerzorgersTable extends Table {
 public $primaryKey = 'verzorger_id';
 
 public function initialize(array $config) {
 $this-belongsToMany('Leerlingen', 
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }

 class LeerlingenTable extends Table {
 public $primaryKey = 'leerling_id';
 
 public function initialize(array $config) {
 $this-belongsToMany('Verzorgers', 
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }

 class LeerlingenVerzorgersTable extends Table {
 public function initialize(array $config) {
 $this-belongsTo('Leerlingen');
 $this-belongsTo('Verzorgers');
 }
 }

 Now when i want to retrieve a verzorger with all the leerlingen i get 
 an error that he doesn't know the leerlingen_id this is right because it 
 is 
 leerling_id. But with the verzorgers table he does use the right id and 
 asks for the verzorger_id.

 My relation table looks like this:
 leerlingen_verzorgers
 --
 id
 leerling_id
 verzorgers_id
 jaar

 The generated query looks like this:

 'SELECT Leerlingen.leerling_id AS `Leerlingen__leerling_id`, 
 Leerlingen.voornaam AS `Leerlingen__voornaam`, Leerlingen.achternaam AS 
 `Leerlingen__achternaam`, Leerlingen.geboortedatum AS 
 `Leerlingen__geboortedatum`, Leerlingen.geslacht AS 
 `Leerlingen__geslacht`, Leerlingen.email AS `Leerlingen__email`, 
 Leerlingen.opmerking AS `Leerlingen__opmerking`, LeerlingenVerzorgers.id 
 AS `LeerlingenVerzorgers__id`, LeerlingenVerzorgers.leerling_id AS 
 `LeerlingenVerzorgers__leerling_id`, LeerlingenVerzorgers.verzorger_id AS 
 `LeerlingenVerzorgers__verzorger_id`, LeerlingenVerzorgers.jaar AS 
 `LeerlingenVerzorgers__jaar` FROM leerlingen AS Leerlingen INNER JOIN 
 leerlingen_verzorgers LeerlingenVerzorgers ON 
 (LeerlingenVerzorgers.verzorger_id IN (:c0) AND Leerlingen.leerling_id = 
 (LeerlingenVerzorgers.leerlingen_id))

 so first he uses the right leerling_id but at the end he uses 
 leerlingen_id. Anyone knows what i did wrong?




-- 
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: BelongsToMany model

2014-09-01 Thread Thomas von Hassel
If you use $this-primaryKey($myKey) in your Table model, thats not in the core 
file and a perfectly valid to do.

But, i would mention that when designing your app, it's better to keep 
everything (model names etc) in english so the inflector knows how everything 
is named.

/thomas


On 01 Sep 2014, at 01:34, Abdelmajid el Ibrahimi a.elibrah...@gmail.com wrote:

 i just changed the key to leerlingen_id and it works. Just a workaround but i 
 dont want to screw with the core files. CakePHP is supposed to be easy to use 
 that means that if i follow the tutorial it should do what is says.
 
 Op zondag 31 augustus 2014 21:35:59 UTC+2 schreef José Lorenzo:
 You also have control over what is the foreignKey to use when creating the 
 association. Refer the the ORM docs to customize what the query builder is 
 doing.
 
 On Sunday, August 31, 2014 7:30:36 PM UTC+2, Abdelmajid el Ibrahimi wrote:
 But even if i take that out it still says the same.
 
 Op zondag 31 augustus 2014 11:45:25 UTC+2 schreef José Lorenzo:
 There is no public $primaryKey in CakePHP 3.0
 
 You may use $this-primaryKey($myKey) inside the initialize() method
 
 On Sunday, August 31, 2014 3:54:56 AM UTC+2, Abdelmajid el Ibrahimi wrote:
 I have made two tables leerlingen and verzorgers. Because these have a many 
 to many relation i added a table leerlingen_verzorgers.
 I have added 3 model tables:
 
 class VerzorgersTable extends Table {
 public $primaryKey = 'verzorger_id';
 
 public function initialize(array $config) {
 $this-belongsToMany('Leerlingen', 
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }
 
 class LeerlingenTable extends Table {
 public $primaryKey = 'leerling_id';
 
 public function initialize(array $config) {
 $this-belongsToMany('Verzorgers', 
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }
 
 class LeerlingenVerzorgersTable extends Table {
 public function initialize(array $config) {
 $this-belongsTo('Leerlingen');
 $this-belongsTo('Verzorgers');
 }
 }
 
 Now when i want to retrieve a verzorger with all the leerlingen i get an 
 error that he doesn't know the leerlingen_id this is right because it is 
 leerling_id. But with the verzorgers table he does use the right id and asks 
 for the verzorger_id.
 
 My relation table looks like this:
 leerlingen_verzorgers
 --
 id
 leerling_id
 verzorgers_id
 jaar
 
 The generated query looks like this:
 
 'SELECT Leerlingen.leerling_id AS `Leerlingen__leerling_id`, 
 Leerlingen.voornaam AS `Leerlingen__voornaam`, Leerlingen.achternaam AS 
 `Leerlingen__achternaam`, Leerlingen.geboortedatum AS 
 `Leerlingen__geboortedatum`, Leerlingen.geslacht AS `Leerlingen__geslacht`, 
 Leerlingen.email AS `Leerlingen__email`, Leerlingen.opmerking AS 
 `Leerlingen__opmerking`, LeerlingenVerzorgers.id AS 
 `LeerlingenVerzorgers__id`, LeerlingenVerzorgers.leerling_id AS 
 `LeerlingenVerzorgers__leerling_id`, LeerlingenVerzorgers.verzorger_id AS 
 `LeerlingenVerzorgers__verzorger_id`, LeerlingenVerzorgers.jaar AS 
 `LeerlingenVerzorgers__jaar` FROM leerlingen AS Leerlingen INNER JOIN 
 leerlingen_verzorgers LeerlingenVerzorgers ON 
 (LeerlingenVerzorgers.verzorger_id IN (:c0) AND Leerlingen.leerling_id = 
 (LeerlingenVerzorgers.leerlingen_id))
 
 so first he uses the right leerling_id but at the end he uses leerlingen_id. 
 Anyone knows what i did wrong?
 
 
 -- 
 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: BelongsToMany model

2014-09-01 Thread Abdelmajid el Ibrahimi
I have used it but it still didnt solve the problem. And to make everything
in english is double work for me because then i will need to translate
everything. For a app that is only needed in holland.

Met vriendelijke groet,
A. el Ibrahimi
Op 1 sep. 2014 09:14 schreef Thomas von Hassel darx...@gmail.com:

 If you use $this-primaryKey($myKey) in your Table model, thats not in the
 core file and a perfectly valid to do.

 But, i would mention that when designing your app, it’s better to keep
 everything (model names etc) in english so the inflector knows how
 everything is named.

 /thomas


 On 01 Sep 2014, at 01:34, Abdelmajid el Ibrahimi a.elibrah...@gmail.com
 wrote:

 i just changed the key to leerlingen_id and it works. Just a workaround
 but i dont want to screw with the core files. CakePHP is supposed to be
 easy to use that means that if i follow the tutorial it should do what is
 says.

 Op zondag 31 augustus 2014 21:35:59 UTC+2 schreef José Lorenzo:

 You also have control over what is the foreignKey to use when creating
 the association. Refer the the ORM docs to customize what the query builder
 is doing.

 On Sunday, August 31, 2014 7:30:36 PM UTC+2, Abdelmajid el Ibrahimi wrote:

 But even if i take that out it still says the same.

 Op zondag 31 augustus 2014 11:45:25 UTC+2 schreef José Lorenzo:

 There is no public $primaryKey in CakePHP 3.0

 You may use $this-primaryKey($myKey) inside the initialize() method

 On Sunday, August 31, 2014 3:54:56 AM UTC+2, Abdelmajid el Ibrahimi
 wrote:

 I have made two tables leerlingen and verzorgers. Because these have a
 many to many relation i added a table leerlingen_verzorgers.
 I have added 3 model tables:

 class VerzorgersTable extends Table {
 public $primaryKey = 'verzorger_id';

 public function initialize(array $config) {
 $this-belongsToMany('Leerlingen',
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }

 class LeerlingenTable extends Table {
 public $primaryKey = 'leerling_id';

 public function initialize(array $config) {
 $this-belongsToMany('Verzorgers',
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }

 class LeerlingenVerzorgersTable extends Table {
 public function initialize(array $config) {
 $this-belongsTo('Leerlingen');
 $this-belongsTo('Verzorgers');
 }
 }

 Now when i want to retrieve a verzorger with all the leerlingen i get
 an error that he doesn't know the leerlingen_id this is right because it 
 is
 leerling_id. But with the verzorgers table he does use the right id and
 asks for the verzorger_id.

 My relation table looks like this:
 leerlingen_verzorgers
 --
 id
 leerling_id
 verzorgers_id
 jaar

 The generated query looks like this:

 'SELECT Leerlingen.leerling_id AS `Leerlingen__leerling_id`, 
 Leerlingen.voornaam AS `Leerlingen__voornaam`, Leerlingen.achternaam AS 
 `Leerlingen__achternaam`, Leerlingen.geboortedatum AS 
 `Leerlingen__geboortedatum`, Leerlingen.geslacht AS 
 `Leerlingen__geslacht`, Leerlingen.email AS `Leerlingen__email`, 
 Leerlingen.opmerking AS `Leerlingen__opmerking`, LeerlingenVerzorgers.id 
 AS `LeerlingenVerzorgers__id`, LeerlingenVerzorgers.leerling_id AS 
 `LeerlingenVerzorgers__leerling_id`, LeerlingenVerzorgers.verzorger_id AS 
 `LeerlingenVerzorgers__verzorger_id`, LeerlingenVerzorgers.jaar AS 
 `LeerlingenVerzorgers__jaar` FROM leerlingen AS Leerlingen INNER JOIN 
 leerlingen_verzorgers LeerlingenVerzorgers ON 
 (LeerlingenVerzorgers.verzorger_id IN (:c0) AND Leerlingen.leerling_id = 
 (LeerlingenVerzorgers.leerlingen_id))

 so first he uses the right leerling_id but at the end he uses 
 leerlingen_id. Anyone knows what i did wrong?



 --
 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 a topic in the
 Google Groups CakePHP group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/cake-php/lLkt9FpJLfg/unsubscribe.
 To unsubscribe from this group and all its topics, 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 

Re: BelongsToMany model

2014-09-01 Thread Thomas von Hassel
Im not talking about what the users see, only what the models are called 
internally

/thomas


On 01 Sep 2014, at 12:55, Abdelmajid el Ibrahimi a.elibrah...@gmail.com wrote:

 I have used it but it still didnt solve the problem. And to make everything 
 in english is double work for me because then i will need to translate 
 everything. For a app that is only needed in holland.
 
 Met vriendelijke groet,
 A. el Ibrahimi
 
 Op 1 sep. 2014 09:14 schreef Thomas von Hassel darx...@gmail.com:
 If you use $this-primaryKey($myKey) in your Table model, thats not in the 
 core file and a perfectly valid to do.
 
 But, i would mention that when designing your app, it's better to keep 
 everything (model names etc) in english so the inflector knows how everything 
 is named.
 
 /thomas
 
 
 On 01 Sep 2014, at 01:34, Abdelmajid el Ibrahimi a.elibrah...@gmail.com 
 wrote:
 
 i just changed the key to leerlingen_id and it works. Just a workaround but 
 i dont want to screw with the core files. CakePHP is supposed to be easy to 
 use that means that if i follow the tutorial it should do what is says.
 
 Op zondag 31 augustus 2014 21:35:59 UTC+2 schreef José Lorenzo:
 You also have control over what is the foreignKey to use when creating the 
 association. Refer the the ORM docs to customize what the query builder is 
 doing.
 
 On Sunday, August 31, 2014 7:30:36 PM UTC+2, Abdelmajid el Ibrahimi wrote:
 But even if i take that out it still says the same.
 
 Op zondag 31 augustus 2014 11:45:25 UTC+2 schreef José Lorenzo:
 There is no public $primaryKey in CakePHP 3.0
 
 You may use $this-primaryKey($myKey) inside the initialize() method
 
 On Sunday, August 31, 2014 3:54:56 AM UTC+2, Abdelmajid el Ibrahimi wrote:
 I have made two tables leerlingen and verzorgers. Because these have a many 
 to many relation i added a table leerlingen_verzorgers.
 I have added 3 model tables:
 
 class VerzorgersTable extends Table {
 public $primaryKey = 'verzorger_id';
 
 public function initialize(array $config) {
 $this-belongsToMany('Leerlingen', 
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }
 
 class LeerlingenTable extends Table {
 public $primaryKey = 'leerling_id';
 
 public function initialize(array $config) {
 $this-belongsToMany('Verzorgers', 
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }
 
 class LeerlingenVerzorgersTable extends Table {
 public function initialize(array $config) {
 $this-belongsTo('Leerlingen');
 $this-belongsTo('Verzorgers');
 }
 }
 
 Now when i want to retrieve a verzorger with all the leerlingen i get an 
 error that he doesn't know the leerlingen_id this is right because it is 
 leerling_id. But with the verzorgers table he does use the right id and asks 
 for the verzorger_id.
 
 My relation table looks like this:
 leerlingen_verzorgers
 --
 id
 leerling_id
 verzorgers_id
 jaar
 
 The generated query looks like this:
 
 'SELECT Leerlingen.leerling_id AS `Leerlingen__leerling_id`, 
 Leerlingen.voornaam AS `Leerlingen__voornaam`, Leerlingen.achternaam AS 
 `Leerlingen__achternaam`, Leerlingen.geboortedatum AS 
 `Leerlingen__geboortedatum`, Leerlingen.geslacht AS `Leerlingen__geslacht`, 
 Leerlingen.email AS `Leerlingen__email`, Leerlingen.opmerking AS 
 `Leerlingen__opmerking`, LeerlingenVerzorgers.id AS 
 `LeerlingenVerzorgers__id`, LeerlingenVerzorgers.leerling_id AS 
 `LeerlingenVerzorgers__leerling_id`, LeerlingenVerzorgers.verzorger_id AS 
 `LeerlingenVerzorgers__verzorger_id`, LeerlingenVerzorgers.jaar AS 
 `LeerlingenVerzorgers__jaar` FROM leerlingen AS Leerlingen INNER JOIN 
 leerlingen_verzorgers LeerlingenVerzorgers ON 
 (LeerlingenVerzorgers.verzorger_id IN (:c0) AND Leerlingen.leerling_id = 
 (LeerlingenVerzorgers.leerlingen_id))
 
 
 so first he uses the right leerling_id but at the end he uses leerlingen_id. 
 Anyone knows what i did wrong?
 
 
 -- 
 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 a topic in the Google 
 Groups CakePHP group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/cake-php/lLkt9FpJLfg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 cake-php+unsubscr...@googlegroups.com.
 To 

Re: BelongsToMany model

2014-09-01 Thread Abdelmajid el Ibrahimi
I know what you mean but than i need to translate all my fields to show it
to the users. Now i dont need to do anything the system generates the field
and table names in my view in dutch because that is how my database model
is build. Well it is solved now and i get what the problem is. Because the
verzorgers table is not a problem and the key is searched for is verzorger.
Because in english the s is for plural so he removes the s and knows that
it is the singular form. Where can I find the core orm file in the system.

Met vriendelijke groet,
A. el Ibrahimi
Op 1 sep. 2014 12:56 schreef Thomas von Hassel darx...@gmail.com:

 Im not talking about what the users see, only what the models are called
 internally

 /thomas


 On 01 Sep 2014, at 12:55, Abdelmajid el Ibrahimi a.elibrah...@gmail.com
 wrote:

 I have used it but it still didnt solve the problem. And to make
 everything in english is double work for me because then i will need to
 translate everything. For a app that is only needed in holland.

 Met vriendelijke groet,
 A. el Ibrahimi
 Op 1 sep. 2014 09:14 schreef Thomas von Hassel darx...@gmail.com:

 If you use $this-primaryKey($myKey) in your Table model, thats not in
 the core file and a perfectly valid to do.

 But, i would mention that when designing your app, it’s better to keep
 everything (model names etc) in english so the inflector knows how
 everything is named.

 /thomas


 On 01 Sep 2014, at 01:34, Abdelmajid el Ibrahimi a.elibrah...@gmail.com
 wrote:

 i just changed the key to leerlingen_id and it works. Just a workaround
 but i dont want to screw with the core files. CakePHP is supposed to be
 easy to use that means that if i follow the tutorial it should do what is
 says.

 Op zondag 31 augustus 2014 21:35:59 UTC+2 schreef José Lorenzo:

 You also have control over what is the foreignKey to use when creating
 the association. Refer the the ORM docs to customize what the query builder
 is doing.

 On Sunday, August 31, 2014 7:30:36 PM UTC+2, Abdelmajid el Ibrahimi
 wrote:

 But even if i take that out it still says the same.

 Op zondag 31 augustus 2014 11:45:25 UTC+2 schreef José Lorenzo:

 There is no public $primaryKey in CakePHP 3.0

 You may use $this-primaryKey($myKey) inside the initialize() method

 On Sunday, August 31, 2014 3:54:56 AM UTC+2, Abdelmajid el Ibrahimi
 wrote:

 I have made two tables leerlingen and verzorgers. Because these have
 a many to many relation i added a table leerlingen_verzorgers.
 I have added 3 model tables:

 class VerzorgersTable extends Table {
 public $primaryKey = 'verzorger_id';

 public function initialize(array $config) {
 $this-belongsToMany('Leerlingen',
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }

 class LeerlingenTable extends Table {
 public $primaryKey = 'leerling_id';

 public function initialize(array $config) {
 $this-belongsToMany('Verzorgers',
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }

 class LeerlingenVerzorgersTable extends Table {
 public function initialize(array $config) {
 $this-belongsTo('Leerlingen');
 $this-belongsTo('Verzorgers');
 }
 }

 Now when i want to retrieve a verzorger with all the leerlingen i get
 an error that he doesn't know the leerlingen_id this is right because it 
 is
 leerling_id. But with the verzorgers table he does use the right id and
 asks for the verzorger_id.

 My relation table looks like this:
 leerlingen_verzorgers
 --
 id
 leerling_id
 verzorgers_id
 jaar

 The generated query looks like this:

 'SELECT Leerlingen.leerling_id AS `Leerlingen__leerling_id`, 
 Leerlingen.voornaam AS `Leerlingen__voornaam`, Leerlingen.achternaam AS 
 `Leerlingen__achternaam`, Leerlingen.geboortedatum AS 
 `Leerlingen__geboortedatum`, Leerlingen.geslacht AS 
 `Leerlingen__geslacht`, Leerlingen.email AS `Leerlingen__email`, 
 Leerlingen.opmerking AS `Leerlingen__opmerking`, LeerlingenVerzorgers.id 
 AS `LeerlingenVerzorgers__id`, LeerlingenVerzorgers.leerling_id AS 
 `LeerlingenVerzorgers__leerling_id`, LeerlingenVerzorgers.verzorger_id 
 AS `LeerlingenVerzorgers__verzorger_id`, LeerlingenVerzorgers.jaar AS 
 `LeerlingenVerzorgers__jaar` FROM leerlingen AS Leerlingen INNER JOIN 
 leerlingen_verzorgers LeerlingenVerzorgers ON 
 (LeerlingenVerzorgers.verzorger_id IN (:c0) AND Leerlingen.leerling_id = 
 (LeerlingenVerzorgers.leerlingen_id))

 so first he uses the right leerling_id but at the end he uses 
 leerlingen_id. Anyone knows what i did wrong?



 --
 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 

Re: BelongsToMany model

2014-09-01 Thread Thomas von Hassel
maybe you should post a gist with your code ..


On 01 Sep 2014, at 13:02, Abdelmajid el Ibrahimi a.elibrah...@gmail.com wrote:

 I know what you mean but than i need to translate all my fields to show it to 
 the users. Now i dont need to do anything the system generates the field and 
 table names in my view in dutch because that is how my database model is 
 build. Well it is solved now and i get what the problem is. Because the 
 verzorgers table is not a problem and the key is searched for is verzorger. 
 Because in english the s is for plural so he removes the s and knows that it 
 is the singular form. Where can I find the core orm file in the system.
 
 Met vriendelijke groet,
 A. el Ibrahimi
 
 Op 1 sep. 2014 12:56 schreef Thomas von Hassel darx...@gmail.com:
 Im not talking about what the users see, only what the models are called 
 internally
 
 /thomas
 
 
 On 01 Sep 2014, at 12:55, Abdelmajid el Ibrahimi a.elibrah...@gmail.com 
 wrote:
 
 I have used it but it still didnt solve the problem. And to make everything 
 in english is double work for me because then i will need to translate 
 everything. For a app that is only needed in holland.
 
 Met vriendelijke groet,
 A. el Ibrahimi
 
 Op 1 sep. 2014 09:14 schreef Thomas von Hassel darx...@gmail.com:
 If you use $this-primaryKey($myKey) in your Table model, thats not in the 
 core file and a perfectly valid to do.
 
 But, i would mention that when designing your app, it's better to keep 
 everything (model names etc) in english so the inflector knows how 
 everything is named.
 
 /thomas
 
 
 On 01 Sep 2014, at 01:34, Abdelmajid el Ibrahimi a.elibrah...@gmail.com 
 wrote:
 
 i just changed the key to leerlingen_id and it works. Just a workaround but 
 i dont want to screw with the core files. CakePHP is supposed to be easy to 
 use that means that if i follow the tutorial it should do what is says.
 
 Op zondag 31 augustus 2014 21:35:59 UTC+2 schreef José Lorenzo:
 You also have control over what is the foreignKey to use when creating the 
 association. Refer the the ORM docs to customize what the query builder is 
 doing.
 
 On Sunday, August 31, 2014 7:30:36 PM UTC+2, Abdelmajid el Ibrahimi wrote:
 But even if i take that out it still says the same.
 
 Op zondag 31 augustus 2014 11:45:25 UTC+2 schreef José Lorenzo:
 There is no public $primaryKey in CakePHP 3.0
 
 You may use $this-primaryKey($myKey) inside the initialize() method
 
 On Sunday, August 31, 2014 3:54:56 AM UTC+2, Abdelmajid el Ibrahimi wrote:
 I have made two tables leerlingen and verzorgers. Because these have a many 
 to many relation i added a table leerlingen_verzorgers.
 I have added 3 model tables:
 
 class VerzorgersTable extends Table {
 public $primaryKey = 'verzorger_id';
 
 public function initialize(array $config) {
 $this-belongsToMany('Leerlingen', 
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }
 
 class LeerlingenTable extends Table {
 public $primaryKey = 'leerling_id';
 
 public function initialize(array $config) {
 $this-belongsToMany('Verzorgers', 
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }
 
 class LeerlingenVerzorgersTable extends Table {
 public function initialize(array $config) {
 $this-belongsTo('Leerlingen');
 $this-belongsTo('Verzorgers');
 }
 }
 
 Now when i want to retrieve a verzorger with all the leerlingen i get an 
 error that he doesn't know the leerlingen_id this is right because it is 
 leerling_id. But with the verzorgers table he does use the right id and 
 asks for the verzorger_id.
 
 My relation table looks like this:
 leerlingen_verzorgers
 --
 id
 leerling_id
 verzorgers_id
 jaar
 
 The generated query looks like this:
 
 'SELECT Leerlingen.leerling_id AS `Leerlingen__leerling_id`, 
 Leerlingen.voornaam AS `Leerlingen__voornaam`, Leerlingen.achternaam AS 
 `Leerlingen__achternaam`, Leerlingen.geboortedatum AS 
 `Leerlingen__geboortedatum`, Leerlingen.geslacht AS `Leerlingen__geslacht`, 
 Leerlingen.email AS `Leerlingen__email`, Leerlingen.opmerking AS 
 `Leerlingen__opmerking`, LeerlingenVerzorgers.id AS 
 `LeerlingenVerzorgers__id`, LeerlingenVerzorgers.leerling_id AS 
 `LeerlingenVerzorgers__leerling_id`, LeerlingenVerzorgers.verzorger_id AS 
 `LeerlingenVerzorgers__verzorger_id`, LeerlingenVerzorgers.jaar AS 
 `LeerlingenVerzorgers__jaar` FROM leerlingen AS Leerlingen INNER JOIN 
 leerlingen_verzorgers LeerlingenVerzorgers ON 
 (LeerlingenVerzorgers.verzorger_id IN (:c0) AND Leerlingen.leerling_id = 
 (LeerlingenVerzorgers.leerlingen_id))
 
 
 
 so first he uses the right leerling_id but at the end he uses 
 leerlingen_id. Anyone knows what i did wrong?
 
 
 -- 
 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 

Re: BelongsToMany model

2014-09-01 Thread Thomas von Hassel
https://gist.github.com

On 01 Sep 2014, at 13:08, Abdelmajid el Ibrahimi a.elibrah...@gmail.com wrote:

 What is a gist?
 
 Met vriendelijke groet,
 A. el Ibrahimi
 
 Op 1 sep. 2014 13:04 schreef Thomas von Hassel darx...@gmail.com:
 maybe you should post a gist with your code ..
 
 
 On 01 Sep 2014, at 13:02, Abdelmajid el Ibrahimi a.elibrah...@gmail.com 
 wrote:
 
 I know what you mean but than i need to translate all my fields to show it 
 to the users. Now i dont need to do anything the system generates the field 
 and table names in my view in dutch because that is how my database model is 
 build. Well it is solved now and i get what the problem is. Because the 
 verzorgers table is not a problem and the key is searched for is verzorger. 
 Because in english the s is for plural so he removes the s and knows that it 
 is the singular form. Where can I find the core orm file in the system.
 
 Met vriendelijke groet,
 A. el Ibrahimi
 
 Op 1 sep. 2014 12:56 schreef Thomas von Hassel darx...@gmail.com:
 Im not talking about what the users see, only what the models are called 
 internally
 
 /thomas
 
 
 On 01 Sep 2014, at 12:55, Abdelmajid el Ibrahimi a.elibrah...@gmail.com 
 wrote:
 
 I have used it but it still didnt solve the problem. And to make everything 
 in english is double work for me because then i will need to translate 
 everything. For a app that is only needed in holland.
 
 Met vriendelijke groet,
 A. el Ibrahimi
 
 Op 1 sep. 2014 09:14 schreef Thomas von Hassel darx...@gmail.com:
 If you use $this-primaryKey($myKey) in your Table model, thats not in the 
 core file and a perfectly valid to do.
 
 But, i would mention that when designing your app, it's better to keep 
 everything (model names etc) in english so the inflector knows how 
 everything is named.
 
 /thomas
 
 
 On 01 Sep 2014, at 01:34, Abdelmajid el Ibrahimi a.elibrah...@gmail.com 
 wrote:
 
 i just changed the key to leerlingen_id and it works. Just a workaround 
 but i dont want to screw with the core files. CakePHP is supposed to be 
 easy to use that means that if i follow the tutorial it should do what is 
 says.
 
 Op zondag 31 augustus 2014 21:35:59 UTC+2 schreef José Lorenzo:
 You also have control over what is the foreignKey to use when creating the 
 association. Refer the the ORM docs to customize what the query builder is 
 doing.
 
 On Sunday, August 31, 2014 7:30:36 PM UTC+2, Abdelmajid el Ibrahimi wrote:
 But even if i take that out it still says the same.
 
 Op zondag 31 augustus 2014 11:45:25 UTC+2 schreef José Lorenzo:
 There is no public $primaryKey in CakePHP 3.0
 
 You may use $this-primaryKey($myKey) inside the initialize() method
 
 On Sunday, August 31, 2014 3:54:56 AM UTC+2, Abdelmajid el Ibrahimi wrote:
 I have made two tables leerlingen and verzorgers. Because these have a 
 many to many relation i added a table leerlingen_verzorgers.
 I have added 3 model tables:
 
 class VerzorgersTable extends Table {
 public $primaryKey = 'verzorger_id';
 
 public function initialize(array $config) {
 $this-belongsToMany('Leerlingen', 
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }
 
 class LeerlingenTable extends Table {
 public $primaryKey = 'leerling_id';
 
 public function initialize(array $config) {
 $this-belongsToMany('Verzorgers', 
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }
 
 class LeerlingenVerzorgersTable extends Table {
 public function initialize(array $config) {
 $this-belongsTo('Leerlingen');
 $this-belongsTo('Verzorgers');
 }
 }
 
 Now when i want to retrieve a verzorger with all the leerlingen i get an 
 error that he doesn't know the leerlingen_id this is right because it is 
 leerling_id. But with the verzorgers table he does use the right id and 
 asks for the verzorger_id.
 
 My relation table looks like this:
 leerlingen_verzorgers
 --
 id
 leerling_id
 verzorgers_id
 jaar
 
 The generated query looks like this:
 
 'SELECT Leerlingen.leerling_id AS `Leerlingen__leerling_id`, 
 Leerlingen.voornaam AS `Leerlingen__voornaam`, Leerlingen.achternaam AS 
 `Leerlingen__achternaam`, Leerlingen.geboortedatum AS 
 `Leerlingen__geboortedatum`, Leerlingen.geslacht AS 
 `Leerlingen__geslacht`, Leerlingen.email AS `Leerlingen__email`, 
 Leerlingen.opmerking AS `Leerlingen__opmerking`, LeerlingenVerzorgers.id 
 AS `LeerlingenVerzorgers__id`, LeerlingenVerzorgers.leerling_id AS 
 `LeerlingenVerzorgers__leerling_id`, LeerlingenVerzorgers.verzorger_id AS 
 `LeerlingenVerzorgers__verzorger_id`, LeerlingenVerzorgers.jaar AS 
 `LeerlingenVerzorgers__jaar` FROM leerlingen AS Leerlingen INNER JOIN 
 leerlingen_verzorgers LeerlingenVerzorgers ON 
 (LeerlingenVerzorgers.verzorger_id IN (:c0) AND Leerlingen.leerling_id = 
 (LeerlingenVerzorgers.leerlingen_id))
 
 
 
 
 so first he uses the right leerling_id but 

Re: BelongsToMany model

2014-09-01 Thread Abdelmajid el Ibrahimi
What is a gist?

Met vriendelijke groet,
A. el Ibrahimi
Op 1 sep. 2014 13:04 schreef Thomas von Hassel darx...@gmail.com:

 maybe you should post a gist with your code ..


 On 01 Sep 2014, at 13:02, Abdelmajid el Ibrahimi a.elibrah...@gmail.com
 wrote:

 I know what you mean but than i need to translate all my fields to show it
 to the users. Now i dont need to do anything the system generates the field
 and table names in my view in dutch because that is how my database model
 is build. Well it is solved now and i get what the problem is. Because the
 verzorgers table is not a problem and the key is searched for is verzorger.
 Because in english the s is for plural so he removes the s and knows that
 it is the singular form. Where can I find the core orm file in the system.

 Met vriendelijke groet,
 A. el Ibrahimi
 Op 1 sep. 2014 12:56 schreef Thomas von Hassel darx...@gmail.com:

 Im not talking about what the users see, only what the models are called
 internally

 /thomas


 On 01 Sep 2014, at 12:55, Abdelmajid el Ibrahimi a.elibrah...@gmail.com
 wrote:

 I have used it but it still didnt solve the problem. And to make
 everything in english is double work for me because then i will need to
 translate everything. For a app that is only needed in holland.

 Met vriendelijke groet,
 A. el Ibrahimi
 Op 1 sep. 2014 09:14 schreef Thomas von Hassel darx...@gmail.com:

 If you use $this-primaryKey($myKey) in your Table model, thats not in
 the core file and a perfectly valid to do.

 But, i would mention that when designing your app, it’s better to keep
 everything (model names etc) in english so the inflector knows how
 everything is named.

 /thomas


 On 01 Sep 2014, at 01:34, Abdelmajid el Ibrahimi a.elibrah...@gmail.com
 wrote:

 i just changed the key to leerlingen_id and it works. Just a workaround
 but i dont want to screw with the core files. CakePHP is supposed to be
 easy to use that means that if i follow the tutorial it should do what is
 says.

 Op zondag 31 augustus 2014 21:35:59 UTC+2 schreef José Lorenzo:

 You also have control over what is the foreignKey to use when creating
 the association. Refer the the ORM docs to customize what the query builder
 is doing.

 On Sunday, August 31, 2014 7:30:36 PM UTC+2, Abdelmajid el Ibrahimi
 wrote:

 But even if i take that out it still says the same.

 Op zondag 31 augustus 2014 11:45:25 UTC+2 schreef José Lorenzo:

 There is no public $primaryKey in CakePHP 3.0

 You may use $this-primaryKey($myKey) inside the initialize() method

 On Sunday, August 31, 2014 3:54:56 AM UTC+2, Abdelmajid el Ibrahimi
 wrote:

 I have made two tables leerlingen and verzorgers. Because these have
 a many to many relation i added a table leerlingen_verzorgers.
 I have added 3 model tables:

 class VerzorgersTable extends Table {
 public $primaryKey = 'verzorger_id';

 public function initialize(array $config) {
 $this-belongsToMany('Leerlingen',
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }

 class LeerlingenTable extends Table {
 public $primaryKey = 'leerling_id';

 public function initialize(array $config) {
 $this-belongsToMany('Verzorgers',
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }

 class LeerlingenVerzorgersTable extends Table {
 public function initialize(array $config) {
 $this-belongsTo('Leerlingen');
 $this-belongsTo('Verzorgers');
 }
 }

 Now when i want to retrieve a verzorger with all the leerlingen i
 get an error that he doesn't know the leerlingen_id this is right 
 because
 it is leerling_id. But with the verzorgers table he does use the right 
 id
 and asks for the verzorger_id.

 My relation table looks like this:
 leerlingen_verzorgers
 --
 id
 leerling_id
 verzorgers_id
 jaar

 The generated query looks like this:

 'SELECT Leerlingen.leerling_id AS `Leerlingen__leerling_id`, 
 Leerlingen.voornaam AS `Leerlingen__voornaam`, Leerlingen.achternaam AS 
 `Leerlingen__achternaam`, Leerlingen.geboortedatum AS 
 `Leerlingen__geboortedatum`, Leerlingen.geslacht AS 
 `Leerlingen__geslacht`, Leerlingen.email AS `Leerlingen__email`, 
 Leerlingen.opmerking AS `Leerlingen__opmerking`, 
 LeerlingenVerzorgers.id AS `LeerlingenVerzorgers__id`, 
 LeerlingenVerzorgers.leerling_id AS 
 `LeerlingenVerzorgers__leerling_id`, LeerlingenVerzorgers.verzorger_id 
 AS `LeerlingenVerzorgers__verzorger_id`, LeerlingenVerzorgers.jaar AS 
 `LeerlingenVerzorgers__jaar` FROM leerlingen AS Leerlingen INNER JOIN 
 leerlingen_verzorgers LeerlingenVerzorgers ON 
 (LeerlingenVerzorgers.verzorger_id IN (:c0) AND Leerlingen.leerling_id 
 = (LeerlingenVerzorgers.leerlingen_id))


 so first he uses the right leerling_id but at the end he uses 
 leerlingen_id. Anyone knows what i did wrong?



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

Re: BelongsToMany model

2014-09-01 Thread Stephen S
It'd make more sense to create custom Inflection rules rather than
translating the models into english.

http://book.cakephp.org/3.0/en/core-utility-libraries/inflector.html#inflection-configuration


On 1 September 2014 12:08, Thomas von Hassel darx...@gmail.com wrote:

 https://gist.github.com

 On 01 Sep 2014, at 13:08, Abdelmajid el Ibrahimi a.elibrah...@gmail.com
 wrote:

 What is a gist?

 Met vriendelijke groet,
 A. el Ibrahimi
 Op 1 sep. 2014 13:04 schreef Thomas von Hassel darx...@gmail.com:

 maybe you should post a gist with your code ..


 On 01 Sep 2014, at 13:02, Abdelmajid el Ibrahimi a.elibrah...@gmail.com
 wrote:

 I know what you mean but than i need to translate all my fields to show
 it to the users. Now i dont need to do anything the system generates the
 field and table names in my view in dutch because that is how my database
 model is build. Well it is solved now and i get what the problem is.
 Because the verzorgers table is not a problem and the key is searched for
 is verzorger. Because in english the s is for plural so he removes the s
 and knows that it is the singular form. Where can I find the core orm file
 in the system.

 Met vriendelijke groet,
 A. el Ibrahimi
 Op 1 sep. 2014 12:56 schreef Thomas von Hassel darx...@gmail.com:

 Im not talking about what the users see, only what the models are called
 internally

 /thomas


 On 01 Sep 2014, at 12:55, Abdelmajid el Ibrahimi a.elibrah...@gmail.com
 wrote:

 I have used it but it still didnt solve the problem. And to make
 everything in english is double work for me because then i will need to
 translate everything. For a app that is only needed in holland.

 Met vriendelijke groet,
 A. el Ibrahimi
 Op 1 sep. 2014 09:14 schreef Thomas von Hassel darx...@gmail.com:

 If you use $this-primaryKey($myKey) in your Table model, thats not in
 the core file and a perfectly valid to do.

 But, i would mention that when designing your app, it’s better to keep
 everything (model names etc) in english so the inflector knows how
 everything is named.

 /thomas


 On 01 Sep 2014, at 01:34, Abdelmajid el Ibrahimi 
 a.elibrah...@gmail.com wrote:

 i just changed the key to leerlingen_id and it works. Just a workaround
 but i dont want to screw with the core files. CakePHP is supposed to be
 easy to use that means that if i follow the tutorial it should do what is
 says.

 Op zondag 31 augustus 2014 21:35:59 UTC+2 schreef José Lorenzo:

 You also have control over what is the foreignKey to use when creating
 the association. Refer the the ORM docs to customize what the query 
 builder
 is doing.

 On Sunday, August 31, 2014 7:30:36 PM UTC+2, Abdelmajid el Ibrahimi
 wrote:

 But even if i take that out it still says the same.

 Op zondag 31 augustus 2014 11:45:25 UTC+2 schreef José Lorenzo:

 There is no public $primaryKey in CakePHP 3.0

 You may use $this-primaryKey($myKey) inside the initialize() method

 On Sunday, August 31, 2014 3:54:56 AM UTC+2, Abdelmajid el Ibrahimi
 wrote:

 I have made two tables leerlingen and verzorgers. Because these
 have a many to many relation i added a table leerlingen_verzorgers.
 I have added 3 model tables:

 class VerzorgersTable extends Table {
 public $primaryKey = 'verzorger_id';

 public function initialize(array $config) {
 $this-belongsToMany('Leerlingen',
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }

 class LeerlingenTable extends Table {
 public $primaryKey = 'leerling_id';

 public function initialize(array $config) {
 $this-belongsToMany('Verzorgers',
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }

 class LeerlingenVerzorgersTable extends Table {
 public function initialize(array $config) {
 $this-belongsTo('Leerlingen');
 $this-belongsTo('Verzorgers');
 }
 }

 Now when i want to retrieve a verzorger with all the leerlingen i
 get an error that he doesn't know the leerlingen_id this is right 
 because
 it is leerling_id. But with the verzorgers table he does use the right 
 id
 and asks for the verzorger_id.

 My relation table looks like this:
 leerlingen_verzorgers
 --
 id
 leerling_id
 verzorgers_id
 jaar

 The generated query looks like this:

 'SELECT Leerlingen.leerling_id AS `Leerlingen__leerling_id`, 
 Leerlingen.voornaam AS `Leerlingen__voornaam`, Leerlingen.achternaam 
 AS `Leerlingen__achternaam`, Leerlingen.geboortedatum AS 
 `Leerlingen__geboortedatum`, Leerlingen.geslacht AS 
 `Leerlingen__geslacht`, Leerlingen.email AS `Leerlingen__email`, 
 Leerlingen.opmerking AS `Leerlingen__opmerking`, 
 LeerlingenVerzorgers.id AS `LeerlingenVerzorgers__id`, 
 LeerlingenVerzorgers.leerling_id AS 
 `LeerlingenVerzorgers__leerling_id`, LeerlingenVerzorgers.verzorger_id 
 AS `LeerlingenVerzorgers__verzorger_id`, LeerlingenVerzorgers.jaar AS 
 `LeerlingenVerzorgers__jaar` FROM leerlingen AS Leerlingen 

Re: BelongsToMany model

2014-09-01 Thread Abdelmajid el Ibrahimi
Thank you very much that solved my problem. Didn't now anything about a 
inflector.

Op maandag 1 september 2014 13:10:10 UTC+2 schreef Stephen S:

 It'd make more sense to create custom Inflection rules rather than 
 translating the models into english.


 http://book.cakephp.org/3.0/en/core-utility-libraries/inflector.html#inflection-configuration


 On 1 September 2014 12:08, Thomas von Hassel dar...@gmail.com 
 javascript: wrote:

 https://gist.github.com

 On 01 Sep 2014, at 13:08, Abdelmajid el Ibrahimi a.elib...@gmail.com 
 javascript: wrote:

 What is a gist?

 Met vriendelijke groet,
 A. el Ibrahimi
 Op 1 sep. 2014 13:04 schreef Thomas von Hassel dar...@gmail.com 
 javascript::

 maybe you should post a gist with your code ..


 On 01 Sep 2014, at 13:02, Abdelmajid el Ibrahimi a.elib...@gmail.com 
 javascript: wrote:

 I know what you mean but than i need to translate all my fields to show 
 it to the users. Now i dont need to do anything the system generates the 
 field and table names in my view in dutch because that is how my database 
 model is build. Well it is solved now and i get what the problem is. 
 Because the verzorgers table is not a problem and the key is searched for 
 is verzorger. Because in english the s is for plural so he removes the s 
 and knows that it is the singular form. Where can I find the core orm file 
 in the system.

 Met vriendelijke groet,
 A. el Ibrahimi
 Op 1 sep. 2014 12:56 schreef Thomas von Hassel dar...@gmail.com 
 javascript::

 Im not talking about what the users see, only what the models are 
 called internally

 /thomas


 On 01 Sep 2014, at 12:55, Abdelmajid el Ibrahimi a.elib...@gmail.com 
 javascript: wrote:

 I have used it but it still didnt solve the problem. And to make 
 everything in english is double work for me because then i will need to 
 translate everything. For a app that is only needed in holland.

 Met vriendelijke groet,
 A. el Ibrahimi
 Op 1 sep. 2014 09:14 schreef Thomas von Hassel dar...@gmail.com 
 javascript::

 If you use $this-primaryKey($myKey) in your Table model, thats not in 
 the core file and a perfectly valid to do.

 But, i would mention that when designing your app, it’s better to keep 
 everything (model names etc) in english so the inflector knows how 
 everything is named.

 /thomas


 On 01 Sep 2014, at 01:34, Abdelmajid el Ibrahimi a.elib...@gmail.com 
 javascript: wrote:

 i just changed the key to leerlingen_id and it works. Just a 
 workaround but i dont want to screw with the core files. CakePHP is 
 supposed to be easy to use that means that if i follow the tutorial it 
 should do what is says.

 Op zondag 31 augustus 2014 21:35:59 UTC+2 schreef José Lorenzo:

 You also have control over what is the foreignKey to use when 
 creating the association. Refer the the ORM docs to customize what the 
 query builder is doing.

 On Sunday, August 31, 2014 7:30:36 PM UTC+2, Abdelmajid el Ibrahimi 
 wrote:

 But even if i take that out it still says the same.

 Op zondag 31 augustus 2014 11:45:25 UTC+2 schreef José Lorenzo:

 There is no public $primaryKey in CakePHP 3.0

 You may use $this-primaryKey($myKey) inside the initialize() method

 On Sunday, August 31, 2014 3:54:56 AM UTC+2, Abdelmajid el Ibrahimi 
 wrote:

 I have made two tables leerlingen and verzorgers. Because these 
 have a many to many relation i added a table leerlingen_verzorgers.
 I have added 3 model tables:

 class VerzorgersTable extends Table {
 public $primaryKey = 'verzorger_id';
 
 public function initialize(array $config) {
 $this-belongsToMany('Leerlingen', 
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }

 class LeerlingenTable extends Table {
 public $primaryKey = 'leerling_id';
 
 public function initialize(array $config) {
 $this-belongsToMany('Verzorgers', 
 ['through' = 'LeerlingenVerzorgers',]);
 $this-addBehavior('Timestamp');
 }
 }

 class LeerlingenVerzorgersTable extends Table {
 public function initialize(array $config) {
 $this-belongsTo('Leerlingen');
 $this-belongsTo('Verzorgers');
 }
 }

 Now when i want to retrieve a verzorger with all the leerlingen i 
 get an error that he doesn't know the leerlingen_id this is right 
 because 
 it is leerling_id. But with the verzorgers table he does use the 
 right id 
 and asks for the verzorger_id.

 My relation table looks like this:
 leerlingen_verzorgers
 --
 id
 leerling_id
 verzorgers_id
 jaar

 The generated query looks like this:

 'SELECT Leerlingen.leerling_id AS `Leerlingen__leerling_id`, 
 Leerlingen.voornaam AS `Leerlingen__voornaam`, Leerlingen.achternaam 
 AS `Leerlingen__achternaam`, Leerlingen.geboortedatum AS 
 `Leerlingen__geboortedatum`, Leerlingen.geslacht AS 
 `Leerlingen__geslacht`, Leerlingen.email AS `Leerlingen__email`, 
 Leerlingen.opmerking AS `Leerlingen__opmerking`, 
 

CakePHP 2.5.4 released

2014-09-01 Thread mark_story
The CakePHP core team is proud to announce the immediate availability of 
CakePHP 2.5.4. 2.5.4 is a bugfix release for the 2.5 release branch. A 
short list of the changes you can expect is:

* Improved SMTP auth reply checks.
* Headers are now correctly sent when using ajaxLogin elements with 
AuthComponent.
* Errors in sample schema files were corrected.
* SecurityComponent no longer puts URLs containing a space into the 
blackhole callback.
* Year validation now accepts dates from 1800 and later.
* RequestHandlerComponent will unserialize request bodies on DELETE 
requests.
* Transactions are now rolled back in saveAssociated/saveMany when 
exceptions are raised.
* Model::afterFind() is no longer called twice for hasOne/belongsTo 
associations. It is now only called once, with the model alias format.
* Join building now accepts no conditions. When joins are created with no 
conditions a cross will be created unless where conditions correctly 
restrict the query.
* SchemaShell now correctly handles the --file and --name switches.
* Generated schema files have more predictable names now. Instead of using 
the APP_DIR value, they will always used 'App' for application schema files.
* Exceptions arising from race conditions in FileEngine are now ignored.
* CakeTime now returns '' on invalid input.
* Translation functions correctly format placeholders when the first value 
is null.
* CURRENT_TIMESTAMP is no longer used as a string default value for 
TIMESTAMP columns with UPDATE CURRENT_TIMESTAMP in MySQL.
* Words ending in 'data' are no longer inflected to datum. This means works 
like 'FileMetadata' are not inflected incorrectly.

You can view the full [changelog on 
cakephp.org](http://cakephp.org/changelogs/2.5.4). I'd like to thank the 
people who have contributed to this release. Your bug tickets, 
documentation edits, and patches/pull requests are a big part of what keeps 
CakePHP alive and ticking. Download a [packaged release on 
github](https://github.com/cakephp/cakephp/releases/2.5.4).

-- 
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 - How to send X-CSRF-Token header

2014-09-01 Thread mark_story
Hey Tarique,

Something like:

$(document).ajaxSend(function(e, xhr, settings) {
xhr.setRequestHeader('X-CSRF-Token', '?= 
$this-request-params['_csrfToken'] ?');
});

Should do the trick.

-Mark


On Monday, 1 September 2014 00:02:30 UTC-4, Dr. Tarique Sani wrote:

 Thanks, would really appreciate some code to look at. Please do post if 
 you can when you get to a real computer.

 Tarique




 On Sat, Aug 30, 2014 at 6:11 PM, mark_story mark.st...@gmail.com wrote:

 I do this by adding a header with a jQuery beforeSend hook. I don't have 
 an example handy as I am not at a real computer right now.

 -mark

 --
 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.




 -- 
 =
 Hire a CakePHP dev team : http://sanisoft.com
 =
  

-- 
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.