Vanilla\Addon::getPriority PHP Method

getPriority() public method

An addon's priority determines the order of things like translations, autoloading, and event firing. Addons with higher priorities will generally override addons with lower priority.
public getPriority ( ) : integer
return integer Returns the priority.
    public function getPriority()
    {
        return (int) $this->getInfoValue('priority', Addon::PRIORITY_NORMAL);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Compare two addon's by priority so that they can be sorted.
  *
  * @param Addon $a The first addon to compare.
  * @param Addon $b The second addon to compare.
  * @return int Returns -1, 0, or 1.
  */
 public static function comparePriority(Addon $a, Addon $b)
 {
     if ($a->getPriority() > $b->getPriority()) {
         return -1;
     } elseif ($a->getPriority() < $b->getPriority()) {
         return 1;
     } else {
         return 0;
     }
 }