Exemplo n.º 1
0
 /**
  * Build entity page URL
  *
  * @param \XLite\Model\AEntity $entity Entity
  * @param array                $column Column data
  *
  * @return string
  */
 protected function buildEntityURL(\XLite\Model\AEntity $entity, array $column)
 {
     return \XLite\Core\Converter::buildURL($column[static::COLUMN_LINK], '', array($entity->getUniqueIdentifierName() => $entity->getUniqueIdentifier(), 'page' => 'inventory'));
 }
Exemplo n.º 2
0
 /**
  * Link loaded entity to parent object
  *
  * @param \XLite\Model\AEntity $entity      Loaded entity
  * @param \XLite\Model\AEntity $parent      Entity parent callback
  * @param array                $parentAssoc Entity mapped propery method
  *
  * @return void
  */
 protected function linkLoadedEntity(\XLite\Model\AEntity $entity, \XLite\Model\AEntity $parent, array $parentAssoc)
 {
     if (!$parentAssoc['many'] || !$entity->getUniqueIdentifier() || !$parent->{$parentAssoc}['getter']()->contains($entity)) {
         // Add entity to parent
         $parent->{$parentAssoc}['setter']($entity);
         // Add parent to entity
         if ($parentAssoc['mappedSetter']) {
             $entity->{$parentAssoc}['mappedSetter']($parent);
         }
     }
 }
Exemplo n.º 3
0
 /**
  * Build edit url
  *
  * @param \XLite\Model\AEntity $entity Entity
  *
  * @return array
  */
 protected function buildEditURLCategory($entity)
 {
     return array('category', array('id' => $entity->getUniqueIdentifier()));
 }