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


PHP ObjectAccess::getProperty方法代码示例

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


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

示例1: createsValidFieldInterfaceComponents

 /**
  * @test
  */
 public function createsValidFieldInterfaceComponents()
 {
     $instance = $this->buildViewHelperInstance($this->defaultArguments);
     $instance->render();
     $component = $instance->getComponent(ObjectAccess::getProperty($instance, 'renderingContext', TRUE), ObjectAccess::getProperty($instance, 'arguments', TRUE));
     $this->assertInstanceOf('FluidTYPO3\\Flux\\Form\\WizardInterface', $component);
 }
开发者ID:kersten,项目名称:flux,代码行数:10,代码来源:AbstractWizardViewHelperTestCase.php

示例2: supportsForeignMatchFields

 /**
  * @test
  */
 public function supportsForeignMatchFields()
 {
     $arguments = array('name' => 'test', 'foreignMatchFields' => array('test' => 'test'));
     $instance = $this->buildViewHelperInstance($arguments, array());
     $component = $instance->getComponent(ObjectAccess::getProperty($instance, 'renderingContext', TRUE), ObjectAccess::getProperty($instance, 'arguments', TRUE));
     $this->assertEquals($arguments['foreignMatchFields'], $component->getForeignMatchFields());
 }
开发者ID:busynoggin,项目名称:flux,代码行数:10,代码来源:FalViewHelperTest.php

示例3: isDirtyObject

 /**
  * Checks if object was changed or not
  *
  * @param object $object
  * @return bool
  */
 public static function isDirtyObject($object)
 {
     foreach (array_keys($object->_getProperties()) as $propertyName) {
         try {
             $property = ObjectAccess::getProperty($object, $propertyName);
         } catch (PropertyNotAccessibleException $e) {
             // if property can not be accessed
             continue;
         }
         /**
          * std::Property (string, int, etc..),
          * PHP-Objects (DateTime, RecursiveIterator, etc...),
          * TYPO3-Objects (user, page, etc...)
          */
         if (!$property instanceof ObjectStorage) {
             if ($object->_isDirty($propertyName)) {
                 return true;
             }
         } else {
             /**
              * ObjectStorage
              */
             if ($property->_isDirty()) {
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:olek07,项目名称:GiGaBonus,代码行数:35,代码来源:ObjectUtility.php

示例4: supportsUseOfControllerAndActionSeparator

 /**
  * @test
  */
 public function supportsUseOfControllerAndActionSeparator()
 {
     $arguments = array('label' => 'Test field', 'controllerExtensionName' => 'Flux', 'pluginName' => 'API', 'controllerName' => 'Flux', 'actions' => array(), 'disableLocalLanguageLabels' => FALSE, 'excludeActions' => array(), 'localLanguageFileRelativePath' => '/Resources/Private/Language/locallang_db.xml', 'prefixOnRequiredArguments' => '*', 'subActions' => array(), 'separator' => ' :: ');
     $instance = $this->buildViewHelperInstance($arguments, array(), NULL, $arguments['extensionName'], $arguments['pluginName']);
     $instance->initializeArgumentsAndRender();
     $component = $instance->getComponent(ObjectAccess::getProperty($instance, 'renderingContext', TRUE), ObjectAccess::getProperty($instance, 'arguments', TRUE));
     $this->assertSame($arguments['separator'], $component->getSeparator());
 }
开发者ID:fluidtypo3,项目名称:flux,代码行数:11,代码来源:ControllerActionsViewHelperTest.php

示例5: render

 /**
  * Get a Property from Field by given Marker and Form
  *
  * @param string $marker Field Marker
  * @param Form $form
  * @param string $property Field Property
  * @return string Property
  */
 public function render($marker, Form $form, $property)
 {
     $field = $this->fieldRepository->findByMarkerAndForm($marker, $form->getUid());
     if ($field !== null) {
         return ObjectAccess::getProperty($field, $property);
     }
     return '';
 }
开发者ID:VladStawizki,项目名称:ipl-logistik.de,代码行数:16,代码来源:GetFieldPropertyFromMarkerAndFormViewHelper.php

示例6: canLoadSettings

 /**
  * @test
  */
 public function canLoadSettings()
 {
     $instance = $this->createInstance();
     $instance->loadSettings($this->defaultData);
     foreach ($this->defaultData as $propertyName => $propertyValue) {
         $result = ObjectAccess::getProperty($instance, $propertyName, TRUE);
         $this->assertEquals($propertyValue, $result);
     }
 }
开发者ID:busynoggin,项目名称:flux,代码行数:12,代码来源:AbstractPipeTestCase.php

示例7: validateRequiredProperties

 /**
  * Validates required properties and adds an error for
  * each empty property is empty
  * Expects an array with property names as keys and
  * error codes as values:
  * [
  *  <propertyName> => <errorCode>
  * ]
  *
  * @param $object
  * @param array $requiredProperties An array with property names and error codes
  * @return void
  * @throws \TYPO3\CMS\Extbase\Reflection\Exception\PropertyNotAccessibleException
  */
 protected function validateRequiredProperties($object, $requiredProperties)
 {
     foreach ($requiredProperties as $propertyName => $errorCode) {
         $propertyValue = ObjectAccess::getProperty($object, $propertyName);
         if ($this->isEmpty($propertyValue)) {
             $this->addError($propertyName . ' is required.', $errorCode);
         }
     }
 }
开发者ID:dwenzel,项目名称:t3events_reservation,代码行数:23,代码来源:RequiredPropertiesTrait.php

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

示例9: render

 /**
  * Solution for {outer.{inner}} call in fluid
  *
  * @param object|array $obj object or array
  * @param string $prop property name
  * @return mixed
  */
 public function render($obj, $prop)
 {
     if (is_array($obj) && array_key_exists($prop, $obj)) {
         return $obj[$prop];
     }
     if (is_object($obj)) {
         return ObjectAccess::getProperty($obj, GeneralUtility::underscoredToLowerCamelCase($prop));
     }
     return null;
 }
开发者ID:VladStawizki,项目名称:ipl-logistik.de,代码行数:17,代码来源:VariableInVariableViewHelper.php

示例10: getCountries

 /**
  * Build array with countries
  *
  * @param string $key
  * @param string $value
  * @param string $sortbyField
  * @param string $sorting
  * @return array
  */
 public function getCountries($key = 'isoCodeA3', $value = 'officialNameLocal', $sortbyField = 'isoCodeA3', $sorting = 'asc')
 {
     $countries = $this->countryRepository->findAllOrderedBy($sortbyField, $sorting);
     $countriesArray = [];
     foreach ($countries as $country) {
         /** @var $country \SJBR\StaticInfoTables\Domain\Model\Country */
         $countriesArray[ObjectAccess::getProperty($country, $key)] = ObjectAccess::getProperty($country, $value);
     }
     return $countriesArray;
 }
开发者ID:VladStawizki,项目名称:ipl-logistik.de,代码行数:19,代码来源:CountriesFromStaticInfoTablesService.php

示例11: canTidySourceFromArgument

    /**
     * @test
     */
    public function canTidySourceFromArgument()
    {
        $instance = $this->createInstance();
        if (FALSE === ObjectAccess::getProperty($instance, 'hasTidy', TRUE)) {
            return;
        }
        $source = '<foo> <bar>
			</bar>			</foo>';
        $test = $this->executeViewHelper(array('content' => $source));
        $this->assertNotSame($source, $test);
    }
开发者ID:chrmue01,项目名称:typo3-starter-kit,代码行数:14,代码来源:TidyViewHelperTest.php

示例12: render

 /**
  * Renders the content.
  *
  * @param  string $extensionName Render partial of this extension
  * @param  string $partial       The partial to render
  * @param  array  $arguments     Arguments to pass to the partial
  * @return string
  */
 public function render($extensionName, $partial = null, array $arguments = array())
 {
     // Overload arguments with own extension local settings (to pass own settings to external partial)
     $arguments = $this->loadSettingsIntoArgumentsNonStatic($arguments);
     $oldPartialRootPaths = ObjectAccess::getProperty($this->viewHelperVariableContainer->getView(), 'partialRootPaths', true);
     $newPartialRootPaths = array(ExtensionManagementUtility::extPath($extensionName) . 'Resources/Private/Partials');
     $this->viewHelperVariableContainer->getView()->setPartialRootPaths($newPartialRootPaths);
     $content = $this->viewHelperVariableContainer->getView()->renderPartial($partial, null, $arguments);
     $this->viewHelperVariableContainer->getView()->setPartialRootPaths($oldPartialRootPaths);
     return $content;
 }
开发者ID:qbus-agentur,项目名称:qbtools,代码行数:19,代码来源:RenderExternalViewHelper.php

示例13: updateAction

 /**
  * action update
  *
  * @param User $user
  * @validate $user In2code\Femanager\Domain\Validator\ServersideValidator
  * @validate $user In2code\Femanager\Domain\Validator\CaptchaValidator
  * @return void
  */
 public function updateAction(\Gigabonus\Gbfemanager\Domain\Model\User $user = null)
 {
     if ($user !== NULL && $GLOBALS['TSFE']->fe_user->user['uid'] == $user->getUid()) {
         $telephonelastchanged = ObjectAccess::getProperty($user, 'txGbfemanagerTelephonelastchanged');
         $user->setTxGbfemanagerTelephonelastchanged(time());
         parent::updateAction($user);
     } else {
         // Versuch die uid im FireBug oder Ähnlichem zu manipulieren
         exit;
     }
 }
开发者ID:olek07,项目名称:GiGaBonus,代码行数:19,代码来源:ChangeMobileNumberController.php

示例14: render

 /**
  * Get all fields from form
  *
  * @param Form $form
  * @param string $property
  * @param bool $htmlSpecialChars
  * @return array
  */
 public function render(Form $form, $property = 'title', $htmlSpecialChars = true)
 {
     $fields = [];
     foreach ($form->getPages() as $page) {
         foreach ($page->getFields() as $field) {
             $fieldProperty = ObjectAccess::getProperty($field, $property);
             if ($htmlSpecialChars) {
                 $fieldProperty = htmlspecialchars($fieldProperty);
             }
             $fields[] = $fieldProperty;
         }
     }
     return $fields;
 }
开发者ID:VladStawizki,项目名称:ipl-logistik.de,代码行数:22,代码来源:GetFieldsFromFormViewHelper.php

示例15: createAndTestDummyControllerInstance

 /**
  * @return AbstractFluxController
  */
 protected function createAndTestDummyControllerInstance()
 {
     $record = Records::$contentRecordWithoutParentAndWithoutChildren;
     $record['pi_flexform'] = Xml::SIMPLE_FLEXFORM_SOURCE_DEFAULT_SHEET_ONE_FIELD;
     $record['tx_fed_fcefile'] = 'Flux:Default.html';
     $frontend = new TypoScriptFrontendController($GLOBALS['TYPO3_CONF_VARS'], 1, 0);
     $frontend->cObj = new ContentObjectRenderer();
     $frontend->cObj->start($record);
     $this->performDummyRegistration();
     $controllerClassName = substr(get_class($this), 0, -4);
     /** @var AbstractFluxController $instance */
     $instance = $this->objectManager->get($controllerClassName);
     ObjectAccess::setProperty($instance, 'extensionName', 'Flux', TRUE);
     ObjectAccess::getProperty($instance, 'configurationManager', TRUE)->setContentObject($frontend->cObj);
     return $instance;
 }
开发者ID:chrmue01,项目名称:typo3-starter-kit,代码行数:19,代码来源:ContentControllerTest.php


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