本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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.");
}
示例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);
}
示例7: storeAppBeans
private static function storeAppBeans($appBeans)
{
FileUtil::storeFileContents(self::APP_SCOPE_FILE, serialize($appBeans));
}