예제 #1
0
 public function setNextPosition()
 {
     $className = get_class($this);
     if (!is_integer(self::$nextPosition)) {
         $filter = new ARSelectFilter();
         $filter->setCondition(new EqualsCond(new ARFieldHandle($className, 'productID'), $this->product->get()->getID()));
         $filter->setOrder(new ARFieldHandle($className, 'position'), ARSelectFilter::ORDER_DESC);
         $filter->setLimit(1);
         self::$nextPosition = 0;
         foreach (ActiveRecord::getRecordSet($className, $filter) as $relatedProductGroup) {
             self::$nextPosition = $relatedProductGroup->position->get();
         }
     }
     $this->position->set(++self::$nextPosition);
 }
예제 #2
0
 public function delete()
 {
     foreach ($this->getFiles() as $productFile) {
         $productFile->deleteFile();
     }
     return parent::delete();
 }
예제 #3
0
 public static function mergeGroupsWithFields($groups, $fields)
 {
     return parent::mergeGroupsWithFields(__CLASS__, $groups, $fields);
 }