public function findByUser($user, array $options = array())
    {
        if (!$user instanceof User) {
            $user = $this->api('subbly.user')->find($user);
        }

        $query = $this->newCollectionQuery($options);
        $query->with(array('user' => function ($query) use ($user) {
            $query->where('uid', '=', $user->uid);
        }));

        return new Collection($query);
    }
public function findByUser($user, array $options = array())
    {
        if (!$user instanceof User) {
            $user = $this->api('subbly.user')->find($user);
        }

        $query = $this->newCollectionQuery($options);
        $query->with(array('user' => function ($query) use ($user) {
            $query->where('uid', '=', $user->uid);
        }));

        return new Collection($query);
    }
public function findByUser ( $ user , array $ options = array ( ) ) { if ( ! $ user instanceof User ) { $ user = $ this -> api ( 'subbly.user' ) -> find ( $ user ) ; } $ query = $ this -> newCollectionQuery ( $ options ) ; $ query -> with ( array ( 'user' => function ( $ query ) use ( $ user ) { $ query -> where ( 'uid' , '=' , $ user -> uid ) ; } ) ) ; return new Collection ( $ query ) ; }
Find a UserAddress by User.

@example
$userAddress = Subbly::api('subbly.user_address')->findByUser($user);

@param string|\Subbly\Model\User $user    The User model or the User uid
@param array                     $options Some options

@return \Subbly\Model\Collection

@api
Find a UserAddress by User .