public function getPublisher(User $user)
    {
        foreach ($this->getPublishers() as $publisher) {
            if ($publisher->getUser()->getId() == $user->getId()) {
                return $publisher;
            }
        }

        return null;
    }
public function getPublisher(User $user)
    {
        foreach ($this->getPublishers() as $publisher) {
            if ($publisher->getUser()->getId() == $user->getId()) {
                return $publisher;
            }
        }

        return null;
    }
public function getPublisher ( User $ user ) { foreach ( $ this -> getPublishers ( ) as $ publisher ) { if ( $ publisher -> getUser ( ) -> getId ( ) == $ user -> getId ( ) ) { return $ publisher ; } } return null ; }
Returns an instance of FeedPublisher matching to the given user.

@param User $user

@return FeedPublisher
Returns an instance of FeedPublisher matching to the given user .