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


PHP NodeData::setProperty方法代码示例

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


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

示例1: setProperty

 /**
  * Sets the specified property.
  *
  * If the node has a content object attached, the property will be set there
  * if it is settable.
  *
  * @param string $propertyName Name of the property
  * @param mixed $value Value of the property
  * @return mixed
  * @api
  */
 public function setProperty($propertyName, $value)
 {
     if (!$this->isNodeDataMatchingContext()) {
         $this->materializeNodeData();
     }
     $this->nodeData->setProperty($propertyName, $value);
     $this->context->getFirstLevelNodeCache()->flush();
     $this->emitNodeUpdated($this);
 }
开发者ID:radmiraal,项目名称:TYPO3.TYPO3CR,代码行数:20,代码来源:Node.php

示例2: similarizeClearsPropertiesBeforeAddingNewOnes

 /**
  * @test
  */
 public function similarizeClearsPropertiesBeforeAddingNewOnes()
 {
     /** @var $sourceNode NodeData */
     $sourceNode = $this->getAccessibleMock('TYPO3\\TYPO3CR\\Domain\\Model\\NodeData', array('addOrUpdate'), array('/foo/bar', $this->mockWorkspace));
     $this->inject($sourceNode, 'nodeTypeManager', $this->mockNodeTypeManager);
     $sourceNode->_set('nodeDataRepository', $this->createMock('TYPO3\\Flow\\Persistence\\RepositoryInterface'));
     $this->nodeData->setProperty('someProperty', 'somePropertyValue');
     $this->nodeData->setProperty('someOtherProperty', 'someOtherPropertyValue');
     $sourceNode->setProperty('newProperty', 'newPropertyValue');
     $sourceNode->setProperty('someProperty', 'someOverriddenPropertyValue');
     $this->nodeData->similarize($sourceNode);
     $expectedProperties = array('newProperty' => 'newPropertyValue', 'someProperty' => 'someOverriddenPropertyValue');
     $this->assertEquals($expectedProperties, $this->nodeData->getProperties());
 }
开发者ID:hhoechtl,项目名称:neos-development-collection,代码行数:17,代码来源:NodeDataTest.php

示例3: execute

 /**
  * If AssetList contains only 1 file, and it's of type Audio, turn it into targetNodeType
  *
  * @param \TYPO3\TYPO3CR\Domain\Model\NodeData $node
  * @return void
  */
 public function execute(\TYPO3\TYPO3CR\Domain\Model\NodeData $node)
 {
     $assets = $node->getProperty($this->sourcePropertyName);
     if (count($assets) === 1) {
         $asset = $assets[0];
         if ($asset instanceof $this->assetType) {
             $nodeType = $this->nodeTypeManager->getNodeType($this->targetNodeType);
             $node->setNodeType($nodeType);
             $node->setProperty($this->targetPropertyName, $asset);
             $node->removeProperty($this->sourcePropertyName);
             echo "Converted AssetList with asset of type" . $this->assetType . " to node of type " . $this->targetNodeType . "\n";
         }
     }
 }
开发者ID:Weissheiten,项目名称:Sfi.Shared,代码行数:20,代码来源:ConvertAssetsToAudioTransformation.php

示例4: setProperty

 /**
  * Sets the specified property.
  *
  * If the node has a content object attached, the property will be set there
  * if it is settable.
  *
  * @param string $propertyName Name of the property
  * @param mixed $value Value of the property
  * @return mixed
  * @api
  */
 public function setProperty($propertyName, $value)
 {
     if (!$this->isNodeDataMatchingContext()) {
         $this->materializeNodeData();
     }
     // Arrays could potentially contain entities and objects could be entities. In that case even if the object is the same it needs to be persisted in NodeData.
     if (!is_object($value) && !is_array($value) && $this->getProperty($propertyName) === $value) {
         return;
     }
     $oldValue = $this->hasProperty($propertyName) ? $this->getProperty($propertyName) : null;
     $this->emitBeforeNodePropertyChange($this, $propertyName, $oldValue, $value);
     $this->nodeData->setProperty($propertyName, $value);
     $this->context->getFirstLevelNodeCache()->flush();
     $this->emitNodePropertyChanged($this, $propertyName, $oldValue, $value);
     $this->emitNodeUpdated($this);
 }
开发者ID:rderidder,项目名称:neos-development-collection,代码行数:27,代码来源:Node.php

示例5: execute

 /**
  * Change the property on the given node.
  *
  * @param NodeData $node
  * @return NodeData
  */
 public function execute(NodeData $node)
 {
     $reference = (string) $node->getProperty('plugin');
     $workspace = $node->getWorkspace();
     do {
         if ($this->reverse === false && preg_match(NodeInterface::MATCH_PATTERN_PATH, $reference)) {
             $pluginNode = $this->nodeDataRepository->findOneByPath($reference, $node->getWorkspace());
         } else {
             $pluginNode = $this->nodeDataRepository->findOneByIdentifier($reference, $node->getWorkspace());
         }
         if (isset($pluginNode)) {
             break;
         }
         $workspace = $workspace->getBaseWorkspace();
     } while ($workspace && $workspace->getName() !== 'live');
     if (isset($pluginNode)) {
         $node->setProperty('plugin', $this->reverse === false ? $pluginNode->getIdentifier() : $pluginNode->getPath());
     }
     return $node;
 }
开发者ID:mgoldbeck,项目名称:neos-development-collection,代码行数:26,代码来源:PluginViewTransformation.php

示例6: execute

 /**
  * Strips tags on the value of the property to work on.
  *
  * @param NodeData $node
  * @return void
  */
 public function execute(NodeData $node)
 {
     $node->setProperty($this->propertyName, strip_tags($node->getProperty($this->propertyName)));
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:10,代码来源:StripTagsOnProperty.php

示例7: execute

 /**
  * Strips tags on the value of the property to work on.
  *
  * @param \TYPO3\TYPO3CR\Domain\Model\NodeData $node
  * @return void
  */
 public function execute(\TYPO3\TYPO3CR\Domain\Model\NodeData $node)
 {
     $node->setProperty($this->propertyName, strip_tags($node->getProperty($this->propertyName)));
 }
开发者ID:radmiraal,项目名称:neos-development-collection,代码行数:10,代码来源:StripTagsOnProperty.php

示例8: execute

 /**
  * Renames the configured property to the new name.
  *
  * @param \TYPO3\TYPO3CR\Domain\Model\NodeData $node
  * @return void
  */
 public function execute(\TYPO3\TYPO3CR\Domain\Model\NodeData $node)
 {
     $node->setProperty($this->newPropertyName, $node->getProperty($this->oldPropertyName));
     $node->removeProperty($this->oldPropertyName);
 }
开发者ID:hlubek,项目名称:neos-development-collection,代码行数:11,代码来源:RenameProperty.php

示例9: execute

 /**
  * Change the property on the given node.
  *
  * @param NodeData $node
  * @return void
  */
 public function execute(NodeData $node)
 {
     $currentPropertyValue = $node->getProperty($this->propertyName);
     $newValueWithReplacedCurrentValue = str_replace($this->currentValuePlaceholder, $currentPropertyValue, $this->newValue);
     $newValueWithReplacedSearch = str_replace($this->search, $this->replace, $newValueWithReplacedCurrentValue);
     $node->setProperty($this->propertyName, $newValueWithReplacedSearch);
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:13,代码来源:ChangePropertyValue.php

示例10: execute

 /**
  * Add the new property with the given value on the given node.
  *
  * @param \TYPO3\TYPO3CR\Domain\Model\NodeData $node
  * @return void
  */
 public function execute(\TYPO3\TYPO3CR\Domain\Model\NodeData $node)
 {
     $node->setProperty($this->newPropertyName, $this->value);
 }
开发者ID:radmiraal,项目名称:neos-development-collection,代码行数:10,代码来源:AddNewProperty.php

示例11: execute

 /**
  * Change the property on the given node.
  *
  * @param NodeData $node
  * @return NodeData
  */
 public function execute(NodeData $node)
 {
     $headlineTag = substr($node->getProperty('type'), 0, 2);
     $node->setProperty('title', sprintf('<%1$s>%2$s</%1$s>', $headlineTag, $node->getProperty('title')));
     return $node;
 }
开发者ID:neos,项目名称:Neos.NeosIo,代码行数:12,代码来源:HeadlineTransformation.php

示例12: execute

 /**
  * Change the property on the given node.
  *
  * @param \TYPO3\TYPO3CR\Domain\Model\NodeData $node
  * @return void
  */
 public function execute(\TYPO3\TYPO3CR\Domain\Model\NodeData $node)
 {
     $currentPropertyValue = $node->getProperty($this->propertyName);
     $newPropertyValue = strtolower($currentPropertyValue);
     $node->setProperty($this->propertyName, $newPropertyValue);
 }
开发者ID:patrickreck,项目名称:Swisscom.Neos.CaseInsensitiveUrls,代码行数:12,代码来源:ChangePropertyValueToLowercase.php

示例13: execute

 /**
  * Add the new property with the given value on the given node.
  *
  * @param NodeData $node
  * @return void
  */
 public function execute(NodeData $node)
 {
     $node->setProperty($this->newPropertyName, $this->value);
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:10,代码来源:AddNewProperty.php

示例14: execute

 /**
  * Renames the configured property to the new name.
  *
  * @param NodeData $node
  * @return void
  */
 public function execute(NodeData $node)
 {
     $node->setProperty($this->newPropertyName, $node->getProperty($this->oldPropertyName));
     $node->removeProperty($this->oldPropertyName);
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:11,代码来源:RenameProperty.php

示例15: execute

 /**
  * @param \TYPO3\TYPO3CR\Domain\Model\NodeData $node
  * @return void
  */
 public function execute(\TYPO3\TYPO3CR\Domain\Model\NodeData $node)
 {
     $sourcePropertyValue = $node->getProperty($this->sourcePropertyName);
     $node->setProperty($this->targetPropertyName, [$sourcePropertyValue]);
 }
开发者ID:psmb,项目名称:KateheoDistr,代码行数:9,代码来源:ReferenceToReferences.php


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