getPriority() public method

Get the priority of the menu item
public getPriority ( ) : integer
return integer
コード例 #1
0
 public function testSetDataWithArray()
 {
     $item = new \ElggMenuItem('name', 'text', 'url');
     $item->setData(array('priority' => 88, 'new' => 64));
     $this->assertEquals(88, $item->getData('priority'));
     $this->assertEquals(88, $item->getPriority());
     $this->assertEquals(64, $item->getData('new'));
 }
コード例 #2
0
ファイル: ElggMenuBuilder.php プロジェクト: thehereward/Elgg
 /**
  * Compare two menu items by their priority
  *
  * @param \ElggMenuItem $a Menu item
  * @param \ElggMenuItem $b Menu item
  * @return bool
  * @deprecated 1.9 Use compareByPriority()
  */
 public static function compareByWeight($a, $b)
 {
     elgg_deprecated_notice("\\ElggMenuBuilder::compareByWeight() deprecated by \\ElggMenuBuilder::compareByPriority", 1.9);
     $aw = $a->getPriority();
     $bw = $b->getPriority();
     if ($aw == $bw) {
         return $a->getData('original_order') - $b->getData('original_order');
     }
     return $aw - $bw;
 }
コード例 #3
0
ファイル: ElggMenuBuilder.php プロジェクト: elgg/elgg
 /**
  * Compare two menu items by their priority
  *
  * @param \ElggMenuItem $a Menu item
  * @param \ElggMenuItem $b Menu item
  * @return bool
  * @since 1.9.0
  */
 public static function compareByPriority($a, $b)
 {
     $aw = $a->getPriority();
     $bw = $b->getPriority();
     if ($aw == $bw) {
         return $a->getData('original_order') - $b->getData('original_order');
     }
     return $aw - $bw;
 }