Пример #1
0
 /**
  * Read storage
  *
  * @param \XLite\Model\Base\Storage $storage Storage
  *
  * @return void
  */
 protected function readStorage(\XLite\Model\Base\Storage $storage)
 {
     if ($this->storageKey) {
         $this->storageKey->incrementAttempt();
         \XLite\Core\Database::getEM()->flush();
     }
     parent::readStorage($storage);
 }
Пример #2
0
 /**
  * Get storage
  *
  * @return \XLite\Model\Base\Storage|null
  */
 protected function getStorage()
 {
     if ($this->getCapostLinkId()) {
         // Get storage by a link
         $this->storage = $this->getCapostStorageByLink();
     } else {
         $this->storage = parent::getStorage();
     }
     if (isset($this->storage) && !$this->checkCapostStorageAccess($this->storage)) {
         // Unauthorized request
         $this->storage = null;
     }
     return $this->storage;
 }