示例#1
0
 /**
  * Add a file
  *
  * @param \XLite\Module\XC\CanadaPost\Model\Order\Parcel\Shipment\Tracking\File $newFile Tracking file
  *
  * @return void
  */
 public function addFile(\XLite\Module\XC\CanadaPost\Model\Order\Parcel\Shipment\Tracking\File $newFile)
 {
     $newFile->setTrackingDetails($this);
     $this->addFiles($newFile);
 }
示例#2
0
 /**
  * Check - is tracking file allowed for a user
  *
  * @param \XLite\Module\XC\CanadaPost\Model\Order\Parcel\Shipment\Tracking\File $storage File object 
  *
  * @return boolean
  */
 protected function checkCapostTrackingFileAccess(\XLite\Module\XC\CanadaPost\Model\Order\Parcel\Shipment\Tracking\File $storage)
 {
     $result = false;
     if (\XLite\Core\Auth::getInstance()->isLogged() && (\XLite\Core\Auth::getInstance()->isAdmin() || \XLite\Core\Auth::getInstance()->getProfile()->getProfileId() == $storage->getTrackingDetails()->getShipment()->getParcel()->getOrder()->getOrigProfile()->getProfileId())) {
         $result = true;
     }
     return $result;
 }
 /**
  * {@inheritDoc}
  */
 public function prepareEntityBeforeCommit($type)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'prepareEntityBeforeCommit', array($type));
     return parent::prepareEntityBeforeCommit($type);
 }