<?php


class Interest extends AppModel
{

    public $useTable = 'interest';



    public function getDetails($id)
    {
        return $this->find('first', array(
            'conditions' => array(



                'Interest.id'=> $id,




            )
        ));
    }
    public function getRandomInterestIDs()
    {
        $rand = rand(3,8);
        return $this->find('all', array(

            'limit'=>$rand,
            'order'=>'rand()'
        ));
    }
    public function ifExist($title)
    {
        return $this->find('first', array(
            'conditions' => array(



                'Interest.title'=> $title,




            )
        ));
    }

    public function getInterestsAgainstSection($section_id)
    {
        return $this->find('all', array(
            'conditions' => array(



                'Interest.interest_section_id'=> $section_id,




            ),
            'order'=>'Interest.order ASC'
        ));
    }


    public function getAll()
    {
        return $this->find('all', array(

            'order'=>'Gift.featured DESC'

        ));
    }







}
?>