Is there a way to do reusability?
I use a plugin in Silex to use ORM with it, and in every Entity I have to use it as follows:
use Doctrine\ORM\Mapping\Entity,
Doctrine\ORM\Mapping\Table,
Doctrine\ORM\Mapping\Id,
Doctrine\ORM\Mapping\Column,
Doctrine\ORM\Mapping\GeneratedValue,
Doctrine\ORM\Mapping\ManyToOne,
Doctrine\ORM\Mapping\ManyToOne;
So my question is: is there "reuse" in PHP like Java? I mean:
use Doctrine\ORM\Mapping\*;
Or maybe use the autoload method created by Silex / Symfony or something like that?
source
share