views:

159

answers:

1

my problem is that can i give condition [ 'BookTitleMaster.id' => $xtitid, ] as like below

$bbookinfs = $this->BookStockin->BookIssue->find('all', array(
    'conditions' => array('return_status' => 2),
    'contain' => array(
        'BookStockin' => array(
            'BookTitleMaster' => array(
                'BookTitleMaster.id' => $xtitid,
                'fields' => array('id','title','sub_title','book_material_type_id','book_author_id','course_detail_id','isbn_no','book_publisher_id','pub_year','pub_place','desc','no_pages','volume'),
                'BookMaterialType' => array('name'),
                'CourseDetail' => array('name'),
                'BookPublisher' => array('name'),
                'BookAuthor' => array('name')       
            )
        )
    )
));
A: 

I believe that you miss is:

'conditions' =>  array('BookTitleMaster.id' => $xtitid),

So, your final code should be:

$bbookinfs = $this->BookStockin->BookIssue->find('all', array(
'conditions' => array('return_status' => 2),
'contain' => array(
    'BookStockin' => array(
        'BookTitleMaster' => array(
            'conditions' =>  array('BookTitleMaster.id' => $xtitid),
            'fields' => array('id','title','sub_title','book_material_type_id','book_author_id','course_detail_id','isbn_no','book_publisher_id','pub_year','pub_place','desc','no_pages','volume'),
            'BookMaterialType' => array('name'),
            'CourseDetail' => array('name'),
            'BookPublisher' => array('name'),
            'BookAuthor' => array('name')       
        )
    )
)

));

HTH

Nik