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


PHP NodeData::hasProperty方法代码示例

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


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

示例1: propertyFunctionsUseAContentObjectIfOneHasBeenDefined

    /**
     * @test
     */
    public function propertyFunctionsUseAContentObjectIfOneHasBeenDefined()
    {
        $this->inject($this->nodeData, 'persistenceManager', $this->createMock('TYPO3\\Flow\\Persistence\\PersistenceManagerInterface'));
        $className = uniqid('Test');
        eval('
			class ' . $className . ' {
				public $title = "My Title";
				public $body = "My Body";
			}
		');
        $contentObject = new $className();
        $this->nodeData->setContentObject($contentObject);
        $this->assertTrue($this->nodeData->hasProperty('title'));
        $this->assertFalse($this->nodeData->hasProperty('iltfh'));
        $this->assertEquals('My Body', $this->nodeData->getProperty('body'));
        $this->assertEquals('My Title', $this->nodeData->getProperty('title'));
        $this->assertEquals(array('title' => 'My Title', 'body' => 'My Body'), $this->nodeData->getProperties());
        $actualPropertyNames = $this->nodeData->getPropertyNames();
        sort($actualPropertyNames);
        $this->assertEquals(array('body', 'title'), $actualPropertyNames);
        $this->nodeData->setProperty('title', 'My Other Title');
        $this->nodeData->setProperty('body', 'My Other Body');
        $this->assertEquals('My Other Body', $this->nodeData->getProperty('body'));
        $this->assertEquals('My Other Title', $this->nodeData->getProperty('title'));
    }
开发者ID:hhoechtl,项目名称:neos-development-collection,代码行数:28,代码来源:NodeDataTest.php

示例2: matches

 /**
  * Returns TRUE if the given node has the property and the value is not empty.
  *
  * @param NodeData $node
  * @return boolean
  */
 public function matches(NodeData $node)
 {
     if ($node->hasProperty($this->propertyName)) {
         $propertyValue = $node->getProperty($this->propertyName);
         return !empty($propertyValue);
     }
     return false;
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:14,代码来源:PropertyNotEmpty.php

示例3: matches

 /**
  * Returns TRUE if the given node has the property and the value is not empty.
  *
  * @param \TYPO3\TYPO3CR\Domain\Model\NodeData $node
  * @return boolean
  */
 public function matches(\TYPO3\TYPO3CR\Domain\Model\NodeData $node)
 {
     if ($node->hasProperty($this->propertyName)) {
         $propertyValue = $node->getProperty($this->propertyName);
         return !empty($propertyValue);
     }
     return FALSE;
 }
开发者ID:radmiraal,项目名称:neos-development-collection,代码行数:14,代码来源:PropertyNotEmpty.php

示例4: extractComments

 /**
  * Extract comments and deserialize them
  *
  * @param NodeInterface|NodeData $nodeOrNodeData
  * @return array
  */
 protected function extractComments($nodeOrNodeData)
 {
     if ($nodeOrNodeData->hasProperty('comments')) {
         $comments = $nodeOrNodeData->getProperty('comments');
         if (is_string($comments) && strlen($comments) > 0) {
             return json_decode($comments, TRUE);
         }
     }
     return array();
 }
开发者ID:sandstorm,项目名称:contentcomments,代码行数:16,代码来源:WorkspaceAspect.php

示例5: hasProperty

 /**
  * If this node has a property with the given name.
  *
  * If the node has a content object attached, the property will be checked
  * there.
  *
  * @param string $propertyName
  * @return boolean
  * @api
  */
 public function hasProperty($propertyName)
 {
     return $this->nodeData->hasProperty($propertyName);
 }
开发者ID:radmiraal,项目名称:TYPO3.TYPO3CR,代码行数:14,代码来源:Node.php

示例6: isTransformable

 /**
  * Returns TRUE if the given node has the property to work on.
  *
  * @param NodeData $node
  * @return boolean
  */
 public function isTransformable(NodeData $node)
 {
     return $node->hasProperty($this->propertyName);
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:10,代码来源:StripTagsOnProperty.php

示例7: isTransformable

 /**
  * Returns TRUE if the given node has the property to work on.
  *
  * @param \TYPO3\TYPO3CR\Domain\Model\NodeData $node
  * @return boolean
  */
 public function isTransformable(\TYPO3\TYPO3CR\Domain\Model\NodeData $node)
 {
     return $node->hasProperty($this->propertyName);
 }
开发者ID:radmiraal,项目名称:neos-development-collection,代码行数:10,代码来源:StripTagsOnProperty.php


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