私はCakephp 2.2.4を使用しており、ユーザー ( id = 106 )に属する Lead のリストを取得する必要があります。
クエリの結果は次のとおりです。
array(
    (int) 0 => array(
        'Lead' => array(
            'id' => '6',
            'user_id' => '106',
            'date' => '2012-12-31 22:15:23',
            'ip' => '127.0.0.1',
            'service_id' => '1',
            'location' => 'Rome',
            'message' => 'Message Message',
            'telephone' => null,
            'active' => null
        ),
        'User' => array(
            'id' => '106',
            'email' => 'daje@daje.it',
            'pwd' => '0433c024cb08be13000d59a347e640482843f46f177e95749dc6599c259617fd3491dcb940b47693cbbc7f65a2cc5ef62deca2e600c1be133ad54170f7d1fbd1',
            'role_id' => '3',
            'active' => '1'
        ),
        'Service' => array(
            'id' => '1',
            'name' => 'Primo servizio'
        ),
        'Estimate' => array(
            (int) 0 => array(
                'id' => '1',
                'lead_id' => '6',
                'user_id' => '106'
            )
        )
    )
)
良さそうに見えますが、見積もり (Estimate 配列) をカウントする必要があります。(見積もりテーブルの) すべてのフィールドを含む配列ではなく、見積もりの数を取得したいと思います。
どうすればできますか?
私は欲しい :
それが示すようにリードアレイ
表示されているユーザー配列
示されているサービス配列
見積もり(見積もりの総数のみ...この場合1)
検索は非常に簡単です。
$options = array('conditions' => array('User.id' => 106));
debug($this->Lead->find('all', $options));