About

In this blog I write about my experiences using the CakePHP web framework, the CakePHP world, and everything that could be interesting for a cakebaker.

The cakebaker is Daniel Hofstetter, a software engineer from Switzerland.

Since June 14, 2006, I am a member of the CakePHP team.

Feel free to contact me at daniel-hofstetter (at) gmx (dot) ch. I am also often in the IRC channel #cakephp at irc.freenode.net.

6 Comments

  1. auto
    Posted April 22, 2006 at 10:27 pm | Permalink

    Your site is great. I love all of your CakePHP tips, and the way you stay on top of people’s projects and the development world. Thanks for the time you put into this, because it’s very good!

  2. Stefan Bühne
    Posted June 5, 2006 at 10:51 pm | Permalink

    Hi,

    i will take this way to report a bug in cake (anbd the solution).

    Let us assign some association in a model, say

    class MyModel extends AppModel
    {
    var $belongsTo = array(
    ‘Supplier’ => array(
    ‘className’ => ‘Person’,
    ‘dependent’ => false,
    ‘foreignKey’ => ‘supplier_id’
    )
    );

    }

    The key point is that the assoc name (Supplier) is different from the className (Person). Then recursive reading will fail; you just get data from MyModel and Person, but no more data that Person is associated to.
    Looking in the source (I love open source…) shows that supplier data of the inital query will be stored in a hash under the key ‘Supplier’; that is just as expected.
    When cake builds the sql to read further, say an address that each Person “hasOne”, then the function “insertQueryData” will look for th person id to insert it into the sql. Unfortunately, it looks for it using the model name as the key (remember, the model is named “Person”) and finds just nothing since data was stored using the role name “Supplier”.
    The solution is to pass the alias name of the model (used as key within the data) down the line. It begins in the read function and passes through the queryAssociation function. You can get source code from me if you want.

  3. Jemi
    Posted July 24, 2006 at 5:46 am | Permalink

    hi, i’m new with the cakePHP, and i’m developing a system for hotel inventory management. I think i’m gonna need this application’s source code to help me developing my system.
    So, i hope you can send me your source code to my email.
    Thank you.

  4. Posted July 25, 2006 at 1:22 pm | Permalink

    @Jemi: The software which runs this blog is not written with CakePHP. But you can get the source from http://wordpress.org/download/

  5. Posted August 12, 2006 at 12:42 am | Permalink

    Thanx for your help I hope I can help with one publication, I think many cakers have the same question when they want to make a relation many to many and they want to store other data in the join table besides the ids of the two tables woth the relationship. I have done a work and I wolud like to publish it so other people can learn something. I just need your opinion because Iam not so good with cake yet. Thanx

  6. Posted August 12, 2006 at 12:39 pm | Permalink

    @Boris Barroso: Post a link or send it by email, and I will have a look at it.


%d bloggers like this: