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


PHP FileUtil::storeFileContents方法代码示例

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


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

示例1: generateNoSuchModelException

 private function generateNoSuchModelException(Entity $entity)
 {
     $className = "NoSuch{$entity->getName()}Exception";
     $content = "<?php\nclass {$className} extends Exception {\n\n}\n?>";
     $destination = "src/exceptions/{$className}.php";
     FileUtil::storeFileContents($destination, $content);
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:7,代码来源:ExceptionGenerator.php

示例2: 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

示例3: generate

 public function generate(Entity $entity)
 {
     $className = "{$entity->getName()}Service";
     $destination = "src/impl/service/{$className}.php";
     if (FileUtil::fileExists($destination)) {
         return;
     }
     $content = "<?php\nclass {$className} extends {$className}Base {\n\n}\n?>";
     FileUtil::storeFileContents($destination, $content);
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:10,代码来源:EntityServiceGenerator.php

示例4: generate

 public function generate(Entity $entity)
 {
     $className = "{$entity->getName()}Model";
     $content = "<?php\nabstract class {$className} extends Model {\n\n";
     $content .= $this->gettersAndSetters($entity);
     $content .= $this->getOneToManyGetters($entity);
     $content .= $this->getOneToManyMappedGettersSetters($entity);
     $content .= $this->getManyToManyGetters($entity);
     $content .= "}\n?>";
     // Write file to class
     $destination = "src/service/model/{$className}.php";
     FileUtil::storeFileContents($destination, $content);
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:13,代码来源:EntityModelGenerator.php

示例5: generate

 public function generate($entities)
 {
     PrintUtil::log("Generating sql scripts... ");
     $sql = "";
     foreach ($entities as $entity) {
         $sql .= $this->generateSql($entity) . "\n\n";
     }
     foreach (Singleton::create("ServiceBuilder")->getManyToManyMappingTables() as $table => $props) {
         $sql .= $this->generateMappingTable($table, $props);
     }
     FileUtil::storeFileContents("src/sql/tables.sql", $sql);
     $data = FileUtil::fileExists("src/sql/data.sql") ? FileUtil::getFileContents("src/sql/data.sql") : "";
     FileUtil::storeFileContents("src/sql/all.sql", $sql . $data);
     PrintUtil::logln("SQL scripts generated.");
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:15,代码来源:SqlGenerator.php

示例6: 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

示例7: storeAppBeans

 private static function storeAppBeans($appBeans)
 {
     FileUtil::storeFileContents(self::APP_SCOPE_FILE, serialize($appBeans));
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:4,代码来源:BeanLocator.php


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