Model/Site.php
public function fromUser ( $user_id ) {
		
	    $sites = $this->User->find('first', array(
	    		'conditions' => array(
	    			'User.id' => $user_id
	    			),
	    		'contain' => array(
	    			'Site',
	    		)
	    	));

		if (!empty( $sites['Site'] )) {
			return $sites['Site'];
		} else {
			return null;
		}
	}
public function fromUser ( $user_id ) {
		
	    $sites = $this->User->find('first', array(
	    		'conditions' => array(
	    			'User.id' => $user_id
	    			),
	    		'contain' => array(
	    			'Site',
	    		)
	    	));

		if (!empty( $sites['Site'] )) {
			return $sites['Site'];
		} else {
			return null;
		}
	}
public function fromUser ( $ user_id ) { $ sites = $ this -> User -> find ( 'first' , array ( 'conditions' => array ( 'User.id' => $ user_id ) , 'contain' => array ( 'Site' , ) ) ) ; if ( ! empty ( $ sites [ 'Site' ] ) ) { return $ sites [ 'Site' ] ; } else { return null ; } }
Me devuelve todos los sitios del usuario
@param int $id UserId
Me devuelve todos los sitios del usuario