Exemplo n.º 1
0
 /**
  * Get name of products source
  *
  * @param \XLite\Model\AEntity $entity Entity
  *
  * @return string
  */
 protected function getEntitySourceName($entity)
 {
     return static::t('a2cp-source-code-' . $entity->getterProperty('code'));
 }
Exemplo n.º 2
0
 /**
  * Service method is used to sort options by 'position' value
  *
  * @param \XLite\Model\AEntity $s1 First option
  * @param \XLite\Model\AEntity $s2 Second option
  *
  * @return integer
  */
 protected function compareOptions($s1, $s2)
 {
     $a = $s1->getterProperty('position');
     $b = $s2->getterProperty('position');
     if ($a == $b) {
         $result = 0;
     } else {
         $result = $a > $b ? 1 : -1;
     }
     return $result;
 }