当前位置: 首页>>代码示例>>PHP>>正文


PHP Entity::getFinders方法代码示例

本文整理汇总了PHP中Entity::getFinders方法的典型用法代码示例。如果您正苦于以下问题:PHP Entity::getFinders方法的具体用法?PHP Entity::getFinders怎么用?PHP Entity::getFinders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Entity的用法示例。


在下文中一共展示了Entity::getFinders方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: generate

 public function generate(Entity $entity)
 {
     $className = "{$entity->getName()}Persistence";
     $content = "<?php\nclass {$className} extends Persistence {\n\n" . "\tconst TABLE = \"{$entity->getTable()}\";\n\n";
     foreach ($entity->getFinders() as $finder) {
         $content .= $this->generateFinder($finder, $entity);
         $content .= $this->generateDeleteBy($finder, $entity);
     }
     $content .= $this->generateFindByPrimaryKey($entity);
     $content .= $this->generateCreate($entity);
     $content .= $this->generateRemove($entity);
     $content .= $this->generateUpdate($entity);
     $content .= $this->generateFindAll($entity);
     $content .= $this->generateGetCount($entity);
     $content .= $this->generateGetAsObject($entity);
     foreach (Singleton::create("ServiceBuilder")->getOneToManyMappedProperties($entity) as $property) {
         $content .= $this->generateOneToManyFinder($property);
     }
     foreach (Singleton::create("ServiceBuilder")->getManyToManyMappedProperties($entity) as $property) {
         $content .= $this->generateManyToManyFinder($property);
     }
     foreach ($entity->getManyToManyProperties() as $property) {
         $content .= $this->generateManyToManySetter($property);
     }
     $content .= "}\n?>";
     $destination = "src/service/persistence/{$className}.php";
     FileUtil::storeFileContents($destination, $content);
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:28,代码来源:EntityPersistenceGenerator.php

示例2: generateIndexes

 private function generateIndexes(Entity $entity)
 {
     $indexes = array("\tPRIMARY KEY (`{$entity->getPrimaryKey()->getName()}`)");
     foreach ($entity->getFinders() as $finder) {
         $indexes[] = "\t" . $finder->getIndexDefinition();
     }
     return $indexes;
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:8,代码来源:SqlGenerator.php

示例3: generate

 public function generate(Entity $entity)
 {
     $className = "{$entity->getName()}ServiceBase";
     $content = "<?php\nclass {$className} {\n\n";
     foreach ($entity->getFinders() as $finder) {
         $content .= $this->generateFinder($finder->getMethodSignature());
         $content .= $this->generateDeleteBy($finder->getDeleteByMethodSignature());
     }
     $content .= $this->generateBaseServices($entity);
     foreach (Singleton::create("ServiceBuilder")->getOneToManyMappedProperties($entity) as $property) {
         $content .= $this->generateFinder($property->getFinderSignature());
     }
     foreach (Singleton::create("ServiceBuilder")->getManyToManyMappedProperties($entity) as $property) {
         $content .= $this->generateFinder($property->getFinderSignature());
     }
     foreach ($entity->getManyToManyProperties() as $property) {
         $content .= $this->generateManyToManySetter($property);
     }
     $content .= "}\n?>";
     // Write file to class
     $destination = "src/service/service/{$className}.php";
     FileUtil::storeFileContents($destination, $content);
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:23,代码来源:EntityServiceBaseGenerator.php


注:本文中的Entity::getFinders方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。