I am using two module in my zend project. One is administration and another is client. I have created one entity in administration module. Now, I want to access that file. Should I need to copy that file into Client module's Entity? OR I can access it by giving it's path. If is that so, then what will be the path?
问问题
63 次
2 回答
1
从软件设计的角度来看,您不应该需要实体本身,而是应该创建一个服务,让其他模块访问数据库/实体。
除此之外,只是和use OtherModule\Entity\NewsEntity;
...... new NewsEntity();
这是基本的 PHP 5 命名空间的东西。请参阅120 秒内的命名空间。
于 2013-08-28T18:30:52.527 回答
0
不,您可以使用他们的命名空间访问:
$myEntity = new \EntityModule\EntityName\EntityFolder\Entity();
于 2013-08-28T18:31:05.567 回答