Example #1
0
 /**
  * Get items
  *
  * @return array
  */
 protected function getItems()
 {
     $length = static::CHUNK_LENGTH;
     $chunk = array();
     foreach (\XLite\Model\Repo\Base\Image::getManagedRepositories() as $class) {
         if (0 < \XLite\Core\Database::getRepo($class)->countNoS3Images()) {
             $chunk = array_merge($chunk, \XLite\Core\Database::getRepo($class)->findNoS3Images($length));
             if (count($chunk) < $length) {
                 $length = static::CHUNK_LENGTH - count($chunk);
             } else {
                 break;
             }
         }
     }
     return $chunk;
 }
Example #2
0
 /**
  * Check - has non-S3 images  or not
  * 
  * @return boolean
  */
 protected function hasNoS3Images()
 {
     $result = false;
     foreach (\XLite\Model\Repo\Base\Image::getManagedRepositories() as $class) {
         if (0 < \XLite\Core\Database::getRepo($class)->countNoS3Images()) {
             $result = true;
             break;
         }
     }
     return $result;
 }
Example #3
0
 /**
  * Get items
  *
  * @return array
  */
 protected function getItems()
 {
     $chunk = array();
     foreach (\XLite\Model\Repo\Base\Image::getManagedRepositories() as $class) {
         if (0 < \XLite\Core\Database::getRepo($class)->countS3Images()) {
             $chunk = \XLite\Core\Database::getRepo($class)->findS3Images(static::CHUNK_LENGTH);
             break;
         }
     }
     return $chunk;
 }