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


PHP ObjectAccess::isPropertyGettable方法代码示例

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


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

示例1: getPropertyValue

 /**
  * Load the property value to be used for validation.
  *
  * In case the object is a doctrine proxy, we need to load the real instance first.
  *
  * @param object $object
  * @param string $propertyName
  * @return mixed
  */
 protected function getPropertyValue($object, $propertyName)
 {
     // TODO: add support for lazy loading proxies, if needed
     if (ObjectAccess::isPropertyGettable($object, $propertyName)) {
         return ObjectAccess::getProperty($object, $propertyName);
     } else {
         return ObjectAccess::getProperty($object, $propertyName, TRUE);
     }
 }
开发者ID:Mr-Robota,项目名称:TYPO3.CMS,代码行数:18,代码来源:GenericObjectValidator.php

示例2: isPropertyGettableWorksOnStdClass

 /**
  * @test
  */
 public function isPropertyGettableWorksOnStdClass()
 {
     $stdClassObject = new \stdClass();
     $stdClassObject->property = 'foo';
     $this->assertTrue(\TYPO3\CMS\Extbase\Reflection\ObjectAccess::isPropertyGettable($stdClassObject, 'property'));
     $this->assertFalse(\TYPO3\CMS\Extbase\Reflection\ObjectAccess::isPropertyGettable($stdClassObject, 'undefinedProperty'));
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:10,代码来源:ObjectAccessTest.php

示例3: determineStoragePageIdForNewRecord

 /**
  * Determine the storage page ID for a given NEW record
  *
  * This does the following:
  * - If the domain object has an accessible property 'pid' (i.e. through a getPid() method), that is used to store the record.
  * - If there is a TypoScript configuration "classes.CLASSNAME.newRecordStoragePid", that is used to store new records.
  * - If there is no such TypoScript configuration, it uses the first value of The "storagePid" taken for reading records.
  *
  * @param \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object
  * @return int the storage Page ID where the object should be stored
  */
 protected function determineStoragePageIdForNewRecord(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object = null)
 {
     $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
     if ($object !== null) {
         if (\TYPO3\CMS\Extbase\Reflection\ObjectAccess::isPropertyGettable($object, 'pid')) {
             $pid = \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getProperty($object, 'pid');
             if (isset($pid)) {
                 return (int) $pid;
             }
         }
         $className = get_class($object);
         if (isset($frameworkConfiguration['persistence']['classes'][$className]) && !empty($frameworkConfiguration['persistence']['classes'][$className]['newRecordStoragePid'])) {
             return (int) $frameworkConfiguration['persistence']['classes'][$className]['newRecordStoragePid'];
         }
     }
     $storagePidList = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $frameworkConfiguration['persistence']['storagePid']);
     return (int) $storagePidList[0];
 }
开发者ID:graurus,项目名称:testgit_t37,代码行数:29,代码来源:Backend.php


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