<?php


class Business extends AppModel
{
    public $useTable = 'business';

    public $belongsTo = array(
        'User' => array(
            'className' => 'User',
            'foreignKey' => 'user_id',
            //'fields' => array('User.id','User.email','User.username','User.image','User.device_token')

        ),


    );


    public function getDetails($id)
    {

        return $this->find('first', array(
            'conditions' => array('Business.id' => $id)
        ));

    }
    public function checkBusinessExistAgainstUserID($user_id,$verification_type)
    {

        return $this->find('first', array(
            'conditions' => array(
                'Business.user_id' => $user_id,
                'Business.verification_type' => $verification_type,
            )
        ));

    }











    public function getAll()
    {

        return $this->find('all', array(
            'conditions' => array(
                'User.id >' => 0,

            )
        ));


    }





}

?>