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


PHP Singleton::create方法代码示例

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


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

示例1: generateManyToManySetter

 private function generateManyToManySetter(ManyToManyProperty $property)
 {
     $containerProp = $property->getEntity()->getPrimaryKey()->getName();
     $containedProp = Singleton::create("ServiceBuilder")->getEntity($property->getEntityName())->getPrimaryKey()->getName();
     $signature = "set" . ucfirst($property->getName()) . "(\${$containerProp}, \${$containedProp}s)";
     return "\tpublic function {$signature} {\n\t\t\$this->getPersistence()->{$signature};\n\t}\n\n";
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:7,代码来源:EntityServiceBaseGenerator.php

示例2: __construct

 public function __construct()
 {
     $this->db = Singleton::create("DatabaseManager");
     if (is_null(self::$dbCache)) {
         self::$dbCache = BeanLocator::get("DatabaseCache");
     }
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:7,代码来源:Persistence.php

示例3: __construct

 public function __construct()
 {
     $this->id = rand(100000, 999999);
     if (is_null(self::$settings)) {
         self::$settings = Singleton::create("Settings");
     }
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:7,代码来源:Component.php

示例4: getAsObject

 protected function getAsObject($row)
 {
     $result = new Teacher();
     $result->setNew(false);
     $result->setTeacherId(Singleton::create("NullConverter")->fromDBtoDOM($row["teacherId"]));
     $result->setName(Singleton::create("NullConverter")->fromDBtoDOM($row["name"]));
     return $result;
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:8,代码来源:TeacherPersistence.php

示例5: getAsObject

 protected function getAsObject($row)
 {
     $result = new BoggleGame();
     $result->setNew(false);
     $result->setGameId(Singleton::create("NullConverter")->fromDBtoDOM($row["gameId"]));
     $result->setStarted(Singleton::create("BooleanConverter")->fromDBtoDOM($row["started"]));
     return $result;
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:8,代码来源:BoggleGamePersistence.php

示例6: getAsObject

 protected function getAsObject($row)
 {
     $result = new BogglePlayer();
     $result->setNew(false);
     $result->setPlayerId(Singleton::create("NullConverter")->fromDBtoDOM($row["playerId"]));
     $result->setName(Singleton::create("NullConverter")->fromDBtoDOM($row["name"]));
     $result->setGameId(Singleton::create("NullConverter")->fromDBtoDOM($row["gameId"]));
     return $result;
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:9,代码来源:BogglePlayerPersistence.php

示例7: getAsObject

 protected function getAsObject($row)
 {
     $result = new Address();
     $result->setNew(false);
     $result->setAddressId(Singleton::create("NullConverter")->fromDBtoDOM($row["addressId"]));
     $result->setStreet(Singleton::create("NullConverter")->fromDBtoDOM($row["street"]));
     $result->setLocation(Singleton::create("NullConverter")->fromDBtoDOM($row["location"]));
     return $result;
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:9,代码来源:AddressPersistence.php

示例8: getOneToManyMappedGettersSetters

 private function getOneToManyMappedGettersSetters(Entity $entity)
 {
     $result = "";
     foreach (Singleton::create("ServiceBuilder")->getOneToManyMappedProperties($entity) as $property) {
         $entityName = $property->getEntity()->getName();
         $name = $property->getMappingKey();
         $result .= "\tprivate \${$name};\n\n" . "\tpublic function get" . ucfirst($name) . "() {\n\t\treturn \$this->{$name};\n\t}\n\n" . "\tpublic function get" . $entityName . "() {\n\t\treturn {$entityName}ServiceUtil::get{$entityName}(\$this->{$name});\n\t}\n\n" . "\tpublic function set" . ucfirst($name) . "(\${$name}) {\n\t\t\$this->{$name} = \${$name};\n\t}\n\n";
     }
     return $result;
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:10,代码来源:EntityModelGenerator.php

示例9: getAsObject

 protected function getAsObject($row)
 {
     $result = new BubbleHighScore();
     $result->setNew(false);
     $result->setHscoreId(Singleton::create("NullConverter")->fromDBtoDOM($row["hscoreId"]));
     $result->setName(Singleton::create("NullConverter")->fromDBtoDOM($row["name"]));
     $result->setPlayDate(Singleton::create("DateConverter")->fromDBtoDOM($row["playDate"]));
     $result->setSeconds(Singleton::create("NullConverter")->fromDBtoDOM($row["seconds"]));
     return $result;
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:10,代码来源:BubbleHighScorePersistence.php

示例10: getAsObject

 protected function getAsObject($row)
 {
     $result = new User();
     $result->setNew(false);
     $result->setId(Singleton::create("NullConverter")->fromDBtoDOM($row["id"]));
     $result->setFirstName(Singleton::create("NullConverter")->fromDBtoDOM($row["firstName"]));
     $result->setLastName(Singleton::create("NullConverter")->fromDBtoDOM($row["lastName"]));
     $result->setCreateDate(Singleton::create("DateConverter")->fromDBtoDOM($row["createDate"]));
     $result->setDefault(Singleton::create("BooleanConverter")->fromDBtoDOM($row["default"]));
     return $result;
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:11,代码来源:UserPersistence.php

示例11: moveToDir

 public function moveToDir($destinationDir, $renamedFile = null)
 {
     $newName = is_null($renamedFile) ? $this->getFileName() : $renamedFileName;
     $root = Singleton::create("Settings")->getRootPath();
     $relativeDestination = "{$destinationDir}/{$newName}";
     $uploadDestination = "{$root}/{$relativeDestination}";
     if (!move_uploaded_file($this->tempServerName, $uploadDestination)) {
         throw new FileUploadException("File cannot be moved from temporary directory");
     }
     $this->relativeDestination = $relativeDestination;
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:11,代码来源:UploadedFile.php

示例12: generateMappingTable

 private function generateMappingTable($table, $props)
 {
     $sql = "CREATE TABLE `{$table}` (\n";
     $pkNames = array();
     foreach ($props as $prop) {
         $pk = Singleton::create("ServiceBuilder")->getEntity($prop->getEntityName())->getPrimaryKey();
         $pkName = "`{$pk->getName()}`";
         $sql .= "\t{$pkName} {$pk->getDbType()} NOT NULL,\n";
         $pkNames[] = $pkName;
     }
     return $sql . "\t PRIMARY KEY (" . implode(",", $pkNames) . ")\n);\n\n";
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:12,代码来源:SqlGenerator.php

示例13: getConverter

 private function getConverter()
 {
     $t = is_null($this->type) ? "Null" : $this->type;
     return Singleton::create("Domain{$t}Converter");
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:5,代码来源:MovicoPostVar.php

示例14: getPersistence

 private function getPersistence()
 {
     return Singleton::create("TeamPersistence");
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:4,代码来源:TeamServiceBase.php

示例15: getService

 private static function getService()
 {
     return Singleton::create("BubbleHighScoreService");
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:4,代码来源:BubbleHighScoreServiceUtil.php


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