本文整理汇总了PHP中TYPO3\TYPO3CR\Domain\Model\NodeData::removeProperty方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeData::removeProperty方法的具体用法?PHP NodeData::removeProperty怎么用?PHP NodeData::removeProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\TYPO3CR\Domain\Model\NodeData
的用法示例。
在下文中一共展示了NodeData::removeProperty方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeProperty
/**
* Removes the specified property.
*
* If the node has a content object attached, the property will not be removed on
* that object if it exists.
*
* @param string $propertyName Name of the property
* @return void
* @throws \TYPO3\TYPO3CR\Exception\NodeException if the node does not contain the specified property
*/
public function removeProperty($propertyName)
{
if (!$this->isNodeDataMatchingContext()) {
$this->materializeNodeData();
}
$this->nodeData->removeProperty($propertyName);
$this->context->getFirstLevelNodeCache()->flush();
$this->emitNodeUpdated($this);
}
示例2: removePropertyDoesNotTouchAContentObject
/**
* @test
*/
public function removePropertyDoesNotTouchAContentObject()
{
$this->inject($this->nodeData, 'persistenceManager', $this->createMock('TYPO3\\Flow\\Persistence\\PersistenceManagerInterface'));
$className = uniqid('Test');
eval('class ' . $className . ' {
public $title = "My Title";
}');
$contentObject = new $className();
$this->nodeData->setContentObject($contentObject);
$this->nodeData->removeProperty('title');
$this->assertTrue($this->nodeData->hasProperty('title'));
$this->assertEquals('My Title', $this->nodeData->getProperty('title'));
}
示例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";
}
}
}
示例4: execute
/**
* Remove the property from the given node.
*
* @param NodeData $node
* @return void
*/
public function execute(NodeData $node)
{
$node->removeProperty($this->propertyName);
}
示例5: 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);
}
示例6: execute
/**
* Remove the property from the given node.
*
* @param \TYPO3\TYPO3CR\Domain\Model\NodeData $node
* @return void
*/
public function execute(\TYPO3\TYPO3CR\Domain\Model\NodeData $node)
{
$node->removeProperty($this->propertyName);
}
示例7: 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);
}