Beispiel #1
0
 /**
  * Creates a search object and optionally sets base criteria.
  *
  * @param boolean $default Add default criteria
  * @return \Aimeos\MW\Criteria\Iface Criteria object
  */
 public function createSearch($default = false)
 {
     if ($default === true) {
         return $this->createSearchBase(substr($this->prefix, 0, strlen($this->prefix) - 1));
     }
     return parent::createSearch();
 }
Beispiel #2
0
 /**
  * Creates a search object and optionally sets base criteria.
  *
  * @param boolean $default Add default criteria
  * @return \Aimeos\MW\Criteria\Iface Criteria object
  */
 public function createSearch($default = false)
 {
     $object = parent::createSearch();
     if ($default === true) {
         $langid = $this->getContext()->getLocale()->getLanguageId();
         $expr = array($object->compare('==', 'product.property.languageid', null), $object->compare('==', 'product.property.languageid', $langid));
         $object->setConditions($object->combine('||', $expr));
     }
     return $object;
 }
Beispiel #3
0
 /**
  * Initializes a new common address manager object using the given context object.
  *
  * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects
  *
  * @throws \Aimeos\MShop\Exception if no configuration is available
  */
 public function __construct(\Aimeos\MShop\Context\Item\Iface $context)
 {
     parent::__construct($context);
     $this->searchConfig = $this->getSearchConfig();
     if (($entry = reset($this->searchConfig)) === false) {
         throw new \Aimeos\MShop\Exception(sprintf('Search configuration not available'));
     }
     if (($pos = strrpos($entry['code'], '.')) === false) {
         throw new \Aimeos\MShop\Exception(sprintf('Search configuration for "%1$s" not available', $entry['code']));
     }
     if (($this->prefix = substr($entry['code'], 0, $pos + 1)) === false) {
         throw new \Aimeos\MShop\Exception(sprintf('Search configuration for "%1$s" not available', $entry['code']));
     }
 }
Beispiel #4
0
 /**
  * Creates a search object and sets base criteria.
  *
  * @param boolean $default
  * @return \Aimeos\MW\Criteria\Iface
  */
 public function createSearch($default = false)
 {
     if ($default === true) {
         return $this->createSearchBase('locale.currency');
     }
     return parent::createSearch();
 }
Beispiel #5
0
 /**
  * Initializes the object.
  *
  * @param \Aimeos\MShop\Context\Item\Iface $context Context object
  */
 public function __construct(\Aimeos\MShop\Context\Item\Iface $context)
 {
     parent::__construct($context);
     $this->setResourceName('db-order');
 }
Beispiel #6
0
 /**
  * Removes several items from the index
  *
  * @param array $ids List of product IDs
  * @param string $path Configuration path to the SQL statement to execute
  * @param boolean $siteidcheck If siteid should be used in the statement
  * @param string $name Name of the ID column
  */
 protected function deleteItemsBase(array $ids, $path, $siteidcheck = true, $name = 'prodid')
 {
     if (empty($ids)) {
         return;
     }
     foreach ($this->getSubManagers() as $submanager) {
         $submanager->deleteItems($ids);
     }
     parent::deleteItemsBase($ids, $path, $siteidcheck, $name);
 }
Beispiel #7
0
 /**
  * Initializes the manager decorator.
  *
  * @param \Aimeos\MShop\Common\Manager\Iface $manager Manager object
  * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects
  */
 public function __construct(\Aimeos\MShop\Common\Manager\Iface $manager, \Aimeos\MShop\Context\Item\Iface $context)
 {
     parent::__construct($context);
     $this->manager = $manager;
 }
Beispiel #8
0
 /**
  * Creates a search object.
  *
  * @param boolean $default Add default criteria; Optional
  * @return \Aimeos\MW\Criteria\Iface
  */
 public function createSearch($default = false)
 {
     $search = parent::createSearch($default);
     if ($default === true) {
         $expr = array($search->getConditions(), $search->compare('!=', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED));
         $search->setConditions($search->combine('&&', $expr));
     }
     return $search;
 }
Beispiel #9
0
 /**
  * Creates a search object and sets base criteria.
  *
  * @param boolean $default
  * @return \Aimeos\MW\Criteria\Iface
  */
 public function createSearch($default = false)
 {
     if ($default === true) {
         $search = $this->createSearchBase('locale.site');
     } else {
         $search = parent::createSearch();
     }
     $expr = array($search->compare('==', 'locale.site.level', 0), $search->getConditions());
     $search->setConditions($search->combine('&&', $expr));
     return $search;
 }
Beispiel #10
0
 /**
  * Creates a search object including the base criteria (optionally).
  *
  * @param boolean $default Include default criteria
  * @return \Aimeos\MW\Criteria\Iface Critera object
  */
 public function createSearch($default = false)
 {
     if ($default === true) {
         $prefix = rtrim($this->getPrefix(), '.');
         $object = $this->createSearchBase($prefix);
         $expr = array();
         $curDate = date('Y-m-d H:i:00');
         $expr[] = $object->getConditions();
         $exprTwo = array();
         $exprTwo[] = $object->compare('<=', $prefix . '.datestart', $curDate);
         $exprTwo[] = $object->compare('==', $prefix . '.datestart', null);
         $expr[] = $object->combine('||', $exprTwo);
         $exprTwo = array();
         $exprTwo[] = $object->compare('>=', $prefix . '.dateend', $curDate);
         $exprTwo[] = $object->compare('==', $prefix . '.dateend', null);
         $expr[] = $object->combine('||', $exprTwo);
         $object->setConditions($object->combine('&&', $expr));
         return $object;
     }
     return parent::createSearch();
 }