<?php


class ProductDetail extends AppModel
{
    public $useTable = 'product_detail';

    public $belongsTo = array(
        'Product' => array(
            'className' => 'Product',
            'foreignKey' => 'product_id',

        ),



    );




    public function getDetails($id)
    {
        $this->Behaviors->attach('Containable');
        return $this->find('first', array(
            'conditions' => array('ProductDetail.id' => $id),
            'recursive'=>-1
            //'contain' => array('ProductImage'),
        ));

    }

    public function getDetailsAgainstMealmeID($product_mealme_id)
    {

        return $this->find('first', array(
            'conditions' => array(


                'ProductDetail.product_mealme_id' => $product_mealme_id,


            ),
            'recursive' => -1,
        ));
    }
}