Loops through image records and performs requested operations on them.

@param string $identifier
@return void
430399
protected function _loop($identifier, $options, $action) {
		$count = $this->_getCount($identifier);
		$offset = 0;
		$limit = $this->params['limit'];

		$this->out(__d('file_storage', '{0} record(s) will be processed.' . "\n", $count));

		do {
			$records = $this->_getRecords($identifier, $limit, $offset);
			if (!empty($records)) {
				foreach ($records as $record) {
					$method = '_' . $action . 'Image';
					try {
						$this->{$method}($record, $options);
					} catch (StorageException $e) {
						$this->err($e->getMessage());
					}
				}
			}
			$offset += $limit;
			$this->out(__d('file_storage', '{0} of {1} records processed.', [$limit, $count]));
		} while ($records->count() > 0);
	}
48966
public function addIdentifier($identifier)
    {
        if (!isset($this->identifiers[$identifier])) {
            $this->identifiers[$identifier] = $identifier;
        }

        return $this;
    }
1013215
public function loadByIdentifier($identifier)
    {
        $rows = $this->sectionGateway->loadSectionDataByIdentifier($identifier);

        if (empty($rows)) {
            throw new NotFound('Section', $identifier);
        }

        return $this->createSectionFromArray(reset($rows));
    }
747919
protected function updateByIdentifier($identifier, $data)
	{
		return $this->aggregate[IdentifierServiceProvider::getProviderKey()]->update($identifier->getEntity(), $data);
	}
203677
protected function _getCount($identifier, array $extensions = ['jpg', 'png', 'jpeg']) {
		return $this->Table
			->find()
			->where(['model' => $identifier])
			->andWhere(['extension IN' => $extensions])
			->count();
	}
335770
public function store($identifier, $data)
    {
        // Find the user id
        if (!is_numeric($identifier))
        {
            if(!$identifier = JUserHelper::getUserId($identifier)) {
                $identifier = 0;
            }
        }

        return parent::store($identifier, $data);
    }
485824
public function setIdentifier($identifier) {

		if(false === is_array($identifier)) {
			$identifier = [$identifier];
		}

		$this -> identifier = $identifier;
	}
967282
public function retrieveById($identifier) {
        if (!$this->isValidIdentifierValue($identifier)) {
            return null;
        }
        /** @var RecordInterface $user */
        $user = $this->createEmptyUserRecord()->fromPrimaryKey($identifier, [], $this->getRelationsToFetch());

        return $this->validateUser($user, null);
    }
577143
public function unregister($identifier)
    {
        $this->load();

        parent::unregister($identifier);
        $this->getDrupalCommonConnector()->variable_set($this->section, $this->registry[$this->section]);
    }
394872
public function setIdentifier(Identifier $identifier)
    {
        if ($this->identifier !== null) {
            //TODO: throw exception
        }

        $this->identifier = $identifier;

        return $this;
    }
757998
public function setIdentifier($identifier)
    {
        if ($this->identifier && $this->identifier !== $identifier) {
            throw new MappingException('Cannot map the identifier to more than one property');
        }

        $this->identifier = $identifier;
    }
1037986
public function hasIdentifier($identifier)
    {
        if(!$identifier instanceof ObjectIdentifierInterface) {
            $identifier = $this->getIdentifier($identifier);
        }

        return in_array((string) $identifier, $this->__identifier_list);
    }
182882
public static function setConfig($identifier, array $config)
    {
        $objIdentifier = self::getIdentifier($identifier);
        $strIdentifier = (string) $objIdentifier;

        if (isset(self::$_configs[$strIdentifier])) {
            self::$_configs[$strIdentifier] = self::$_configs[$strIdentifier]->append($config);
        } else {
            self::$_configs[$strIdentifier] = new AnConfig($config);
        }
    }
351621
public function loadSectionDataByIdentifier($identifier)
    {
        $query = $this->dbHandler->createSelectQuery();
        $query->select(
            $this->dbHandler->quoteColumn('id'),
            $this->dbHandler->quoteColumn('identifier'),
            $this->dbHandler->quoteColumn('name')
        )->from(
            $this->dbHandler->quoteTable('ezsection')
        )->where(
            $query->expr->eq(
                $this->dbHandler->quoteColumn('identifier'),
                $query->bindValue($identifier, null, \PDO::PARAM_STR)
            )
        );

        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetchAll(\PDO::FETCH_ASSOC);
    }
175903
public function identifyEntity(ModelInterface $model, &$entity, $identifier)
    {
        $primaryKeys = $model->primaryFields();
        if (count($primaryKeys) !== 1) {
            return;
        }

        $field = reset($primaryKeys)->name();

        $this->setPropertyValue($entity, $field, $identifier);
    }
1284296
public function writeIdentifier($identifier)
    {
        try {
            $this->writeString($identifier);
        } catch (BinaryStreamAccessException $e) {
            $msg = "An error occured while writing an identifier.";
            throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::IDENTIFIER, $e);
        }
    }
151062
protected function deleteJoinTableRecords($identifier)
    {
        foreach ($this->class->associationMappings as $mapping) {
            if ($mapping['type'] !== ClassMetadata::MANY_TO_MANY) {
                continue;
            }

            // @Todo this only covers scenarios with no inheritance or of the same level. Is there something
            // like self-referential relationship between different levels of an inheritance hierarchy? I hope not!
            $selfReferential = ($mapping['targetEntity'] == $mapping['sourceEntity']);
            $class           = $this->class;
            $association     = $mapping;
            $otherColumns    = array();
            $otherKeys       = array();
            $keys            = array();

            if ( ! $mapping['isOwningSide']) {
                $class       = $this->em->getClassMetadata($mapping['targetEntity']);
                $association = $class->associationMappings[$mapping['mappedBy']];
            }

            $joinColumns = $mapping['isOwningSide']
                ? $association['joinTable']['joinColumns']
                : $association['joinTable']['inverseJoinColumns'];


            if ($selfReferential) {
                $otherColumns = (! $mapping['isOwningSide'])
                    ? $association['joinTable']['joinColumns']
                    : $association['joinTable']['inverseJoinColumns'];
            }

            foreach ($joinColumns as $joinColumn) {
                $keys[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
            }

            foreach ($otherColumns as $joinColumn) {
                $otherKeys[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
            }

            if (isset($mapping['isOnDeleteCascade'])) {
                continue;
            }

            $joinTableName = $this->quoteStrategy->getJoinTableName($association, $this->class, $this->platform);

            $this->conn->delete($joinTableName, array_combine($keys, $identifier));

            if ($selfReferential) {
                $this->conn->delete($joinTableName, array_combine($otherKeys, $identifier));
            }
        }
    }