Cakephp从左侧表中获取所有数据

时间:2014-07-01 02:34:54

标签: php cakephp

我正在使用以下绑定

$this->FranchiseZip->bindModel(array(
                'belongsTo'=>array(
                    'Franchise',
                ),

            ),false
        );

它会以格式

返回结果
    Array
(
    [0] => Array
        (
            [FranchiseZip] => Array
                (
                    [id] => 1
                )

            [Franchise] => Array
                (
                    [name] => abc 
                )

        )

但我在FranchiseZip模型中有许多记录,其中Franchise id为null。它不会返回那些行。请告诉我如何在cakephp中获取这些行。我希望得到以下格式的结果

    Array
(
    [0] => Array
        (
            [FranchiseZip] => Array
                (
                    [id] => 1
                )

            [Franchise] => Array
                (
                    [name] => abc 
                )

        )
[1 => Array
        (
            [FranchiseZip] => Array
                (
                    [id] => 123
                )

            [Franchise] => Array
                (
                    [name] => 
                )

        )

感谢

0 个答案:

没有答案