Exemple #1
0
 /**
  * getClasses
  *
  * @param \XLite\Model\Shipping\Method $method ____param_comment____
  *
  * @return \Doctrine\Common\Collections\ArrayCollection
  */
 protected function getClasses(\XLite\Model\Shipping\Method $method)
 {
     $classes = new \Doctrine\Common\Collections\ArrayCollection();
     $postedData = $this->getPostedData('class_ids');
     foreach ((array) $postedData[$method->getMethodId()] as $classId) {
         $class = \XLite\Core\Database::getRepo('\\XLite\\Model\\ProductClass')->findOneById($classId);
         if ($class) {
             if (!$class->getShippingMethods()->contains($method)) {
                 $class->getShippingMethods()->add($method);
             }
             $classes->add($class);
         }
     }
     return $classes;
 }
 /**
  * {@inheritDoc}
  */
 public function getMethodId()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getMethodId', array());
     return parent::getMethodId();
 }