come on man... 4 questions in return?

the annotation is just documentation,
PHPDoc<http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.return.pkg.html>
.

How would one use it? Well, that is up to you ;), you needed it, right? If
it is about a username (string) I would have

public function hasUsername(){
   return is_string($this->username);
}

then: this is possible

echo $user->hasUsername() ? $user->getUsername() : 'no username defined for
User#' . $this->getId();

Now you go ahead and play around!

Cheers




On 19 May 2014 12:46, Nima Sadjadi <[email protected]> wrote:

> Menno, I see you are using annotation for return boolean. I use php
> mapping instead. How can I use your function?
> return (bool)$this->user instanceof \Entities\User;
> Is something correct?
> How do you use this function? Before using $user->getUsername();
> you use that haser function if true then you call getUsername() for
> example?
>
> --
> You received this message because you are subscribed to the Google Groups
> "doctrine-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/doctrine-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to