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


PHP JTableNested::getPath方法代码示例

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


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

示例1: getPath

 public function getPath($pk = null, $diagnostic = false)
 {
     $k = $this->_tbl_key;
     $pk = is_null($pk) ? $this->{$k} : $pk;
     if (!isset(self::$getPath[$pk][(int) $diagnostic])) {
         self::$getPath[$pk][(int) $diagnostic] = parent::getPath($pk, $diagnostic);
     }
     return self::$getPath[$pk][(int) $diagnostic];
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:9,代码来源:comment.php

示例2: testGetPath

 public function testGetPath($nodata = true)
 {
     // Get path of ROOT node
     $pathRoot = $this->object->getPath(1);
     $this->assertEquals(1, count($pathRoot), 'Line: ' . __LINE__ . ' Root path should have 1 element');
     $this->assertEquals('1', $pathRoot[0]->id, 'Line: ' . __LINE__ . ' Path of root should have id=1');
     // Get path of Components node
     $pathComponents = $this->object->getPath(21);
     $this->assertEquals(5, count($pathComponents), 'Line: ' . __LINE__ . ' Components path should have 5 elements');
     $this->assertEquals('1', $pathComponents[0]->id, 'Line: ' . __LINE__ . ' Element 0 should have id=1');
     $this->assertEquals('14', $pathComponents[1]->id, 'Element 1 should have id=14');
     $this->assertEquals('19', $pathComponents[2]->id, 'Element 2 should have id=19');
     $this->assertEquals('20', $pathComponents[3]->id, 'Element 3 should have id=20');
     $this->assertEquals('21', $pathComponents[4]->id, 'Element 4 should have id=21');
     // Get path of invalid id
     $pathInvalid = $this->object->getPath(999);
     $this->assertEquals(0, count($pathInvalid), 'Invalid path should have zero elements');
     // Get path database error
     $badTable = new JTableCategory($this->badDB);
     $this->assertFalse($badTable->getPath(1), 'Line: ' . __LINE__ . ' Should fail with db error');
 }
开发者ID:Joomla-on-NoSQL,项目名称:LaMojo,代码行数:21,代码来源:JTableNestedTest.php


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