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


PHP AbstractEntity类代码示例

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


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

示例1: save

 public function save(AbstractEntity $entity)
 {
     if ($entity->getStorageStructure() == AbstractEntity::DOCUMENT) {
         $dm = new DocumentManager();
         $document = $entity->toDocument();
         $dm->persist($document);
     }
     if ($entity->getStorageStructure() == AbstractEntity::RELATIONAL) {
         $rm = new RecordManager();
         $record = $entity->toRecord();
         $rm->save($record);
     }
 }
开发者ID:pelif,项目名称:curso-design-pattern,代码行数:13,代码来源:PersistenceManager.php

示例2: testConvertFieldName

 public function testConvertFieldName()
 {
     $fieldName = "intro_attended";
     $this->assertEquals('getIntroAttended', AbstractEntity::convertFieldNameToGetterFunctionName($fieldName));
     $fieldName = "status";
     $this->assertEquals('getStatus', AbstractEntity::convertFieldNameToGetterFunctionName($fieldName));
     $fieldName = "start_date_time";
     $this->assertEquals('getStartDateTime', AbstractEntity::convertFieldNameToGetterFunctionName($fieldName));
 }
开发者ID:Endymion1977,项目名称:phonebook,代码行数:9,代码来源:AbstractEntityTest.php

示例3: generateEntityMethods

 /**
  * @param AbstractEntity $entity
  * @param string $indention
  * @return string
  */
 private function generateEntityMethods(AbstractEntity $entity, $indention)
 {
     $methodName = lcfirst($entity->methodNamePrefix() . ucfirst($entity->className()));
     $content = PHP_EOL . $indention . '/**' . PHP_EOL . $indention . ' * @return ' . $entity->className() . PHP_EOL . $indention . ' */' . PHP_EOL . $indention . 'public function ' . $methodName . '()' . PHP_EOL . $indention . '{' . PHP_EOL;
     if ($entity instanceof ObjectEntity) {
         $content .= $indention . $indention . 'return new ' . $entity->className() . '();' . PHP_EOL;
     } else {
         if ($entity instanceof QueryEntity) {
             $content .= $indention . $indention . 'return ' . $entity->className() . '::create();' . PHP_EOL;
         }
     }
     $content .= $indention . '}' . PHP_EOL;
     return $content;
 }
开发者ID:bazzline,项目名称:php_propel_behavior_entity_instantiator,代码行数:19,代码来源:FileContentGenerator.php

示例4: setEntityMeta

 /**
  * Adds meta data to the actual entity object.
  *
  * @param AbstractEntity $entity
  * @param mixed $resultRecord
  */
 protected static function setEntityMeta(AbstractEntity $entity, $resultRecord)
 {
     if ($entity instanceof AbstractLocaleEntity) {
         $entity->addMeta($resultRecord->key, $resultRecord->value, $resultRecord->locale);
     }
 }
开发者ID:Mendim,项目名称:ep3-bs,代码行数:12,代码来源:AbstractLocaleEntityFactory.php

示例5: build

 /**
  * Build a new backup window instance
  *
  * @param \stdClass|array|null $parameters
  */
 public function build($parameters)
 {
     if (is_null($parameters)) {
         return;
     }
     parent::build($parameters);
 }
开发者ID:fideloper,项目名称:DigitalOceanV2,代码行数:12,代码来源:NextBackupWindow.php

示例6: setBeanName

 /**
  * Sets the bean name.
  * 
  * @param string $beanName
  * @throws Exception\InvalidBeanException
  */
 public function setBeanName($beanName)
 {
     if (null !== $this->entityBeanName && $beanName != $this->entityBeanName) {
         throw new Exception\InvalidBeanException($beanName, $this->entityBeanName, $this);
     }
     parent::setBeanName($beanName);
 }
开发者ID:ivan-novakov,项目名称:php-perun-api,代码行数:13,代码来源:GenericEntity.php

示例7: __construct

 public function __construct()
 {
     parent::__construct();
     $this->_name = '';
     $this->_reportedBugs = new ArrayCollection();
     $this->_assignedBugs = new ArrayCollection();
 }
开发者ID:joefallon,项目名称:DoctrineAndPhinxSpike,代码行数:7,代码来源:User.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     $this->_description = '';
     $this->_status = '';
     $this->_products = new ArrayCollection();
 }
开发者ID:joefallon,项目名称:DoctrineAndPhinxSpike,代码行数:7,代码来源:Bug.php

示例9: getChangedProperties

 /**
  * @return array
  * @throws \Exception
  */
 public function getChangedProperties()
 {
     if (!$this->original) {
         throw new \Exception('No original snapshot taken');
     }
     $diff = array_diff_assoc($this->getPropertiesAsArray(), $this->original->getPropertiesAsArray());
     return $diff;
 }
开发者ID:express-ru,项目名称:sdk,代码行数:12,代码来源:AbstractEntity.php

示例10: _createSourceAdapterMock

 /**
  * Create source adapter mock and set it into model object which tested in this class
  *
  * @param array $columns value which will be returned by method getColNames()
  * @return \Magento\ImportExport\Model\Import\AbstractSource|\PHPUnit_Framework_MockObject_MockObject
  */
 protected function _createSourceAdapterMock(array $columns)
 {
     /** @var $source \Magento\ImportExport\Model\Import\AbstractSource|\PHPUnit_Framework_MockObject_MockObject */
     $source = $this->getMockForAbstractClass('Magento\\ImportExport\\Model\\Import\\AbstractSource', [], '', false, true, true, ['getColNames']);
     $source->expects($this->any())->method('getColNames')->will($this->returnValue($columns));
     $this->_model->setSource($source);
     return $source;
 }
开发者ID:,项目名称:,代码行数:14,代码来源:

示例11: __construct

 public function __construct(array $data)
 {
     if (empty($data)) {
         return;
     }
     $photoSizes = $this->initPhotoSizesFromData($data);
     $this->setPhotoSizes($photoSizes);
     parent::__construct($data);
 }
开发者ID:rudestan,项目名称:teebot,代码行数:9,代码来源:PhotoSizeArray.php

示例12: build

 /**
  * @param array $parameters
  */
 public function build(array $parameters)
 {
     parent::build($parameters);
     foreach ($parameters as $property => $value) {
         if ('region' === $property && is_object($value)) {
             $this->region = new Region($value);
         }
     }
 }
开发者ID:mix376,项目名称:DigitalOceanV2,代码行数:12,代码来源:Action.php

示例13: build

 /**
  * @param \stdClass|array $parameters
  */
 public function build($parameters)
 {
     parent::build($parameters);
     foreach ($parameters as $property => $value) {
         if ('region' === $property) {
             $this->region = new Region($value);
             continue;
         }
     }
 }
开发者ID:BAY-A,项目名称:Gravity-Forms-DigitalOcean,代码行数:13,代码来源:Action.php

示例14: build

 /**
  * @param array $parameters
  */
 public function build(array $parameters)
 {
     parent::build($parameters);
     foreach ($parameters as $property => $value) {
         switch ($property) {
             case 'region':
                 if (is_object($value)) {
                     $this->region = new Region($value);
                 }
                 unset($parameters[$property]);
                 break;
         }
     }
 }
开发者ID:robertol,项目名称:DigitalOceanV2,代码行数:17,代码来源:Volume.php

示例15: __construct

 public function __construct()
 {
     parent::__construct();
     $this->roles = new ArrayCollection();
 }
开发者ID:jwoods,项目名称:CE_27,代码行数:5,代码来源:User.php


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