コード例 #1
0
ファイル: TreeUtils.php プロジェクト: Maksold/platform
 /**
  * Returns first node name if nodes is not empty
  *
  * @param GroupNodeDefinition $node
  *
  * @return null|string
  */
 public static function getFirstNodeName(GroupNodeDefinition $node)
 {
     if (!$node->isEmpty()) {
         $firstNode = $node->first();
         return $firstNode->getName();
     }
     return null;
 }
コード例 #2
0
 public function testIsEmpty()
 {
     // empty node
     $node = new GroupNodeDefinition(self::TEST_NAME);
     $this->assertTrue($node->isEmpty());
     // not empty node
     $node = self::getTestGroup();
     $this->assertFalse($node->isEmpty());
 }