Last active
August 29, 2015 14:17
-
-
Save fprochazka/45227e00fb7c798598f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @return ${TYPE_HINT} | |
*/ | |
public ${STATIC} function ${GET_OR_IS}${NAME}() | |
{ | |
#if (${STATIC} == "static") | |
return self::${DS}${FIELD_NAME}; | |
#elseif ($TYPE_HINT.contains("Collection")) | |
return new \Kdyby\Doctrine\Collections\ReadOnlyCollectionWrapper($this->${FIELD_NAME}); | |
#else | |
return $this->${FIELD_NAME}; | |
#end | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Doctrine\Common\Collections\ArrayCollection; | |
class Something | |
{ | |
/** | |
* @ORM\ManyToMany(targetEntity="Tag", cascade={"persist"}) | |
* @var Tag[]|ArrayCollection | |
*/ | |
protected $tags; | |
public function __construct() | |
{ | |
$this->tags = new ArrayCollection(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment