/** * @param \ride\application\orm\entry\ImageTransformationEntry $transformation * @return null */ public function setTransformation(AliasImageTransformationEntry $transformation = NULL) { $isClean = false; if (!$this->transformation && !$transformation || $this->transformation && $transformation && $this->transformation->getId() === $transformation->getId()) { $isClean = true; } $this->transformation = $transformation; if (!$isClean && $this->entryState === self::STATE_CLEAN) { $this->entryState = self::STATE_DIRTY; } }
/** * @param \ride\application\orm\entry\ImageTransformationEntry $imageTransformation * @return null */ public function setImageTransformation(ImageTransformationEntry $imageTransformation = NULL) { if (!isset($this->loadedFields['imageTransformation'])) { $this->loadProperties(); } $oldValue = null; if (array_key_exists('imageTransformation', $this->loadedValues)) { $oldValue = $this->loadedValues['imageTransformation']; } if (!$oldValue && !$imageTransformation || $oldValue && $imageTransformation && $oldValue->getId() === $imageTransformation->getId()) { $this->imageTransformation = $imageTransformation; return; } return parent::setImageTransformation($imageTransformation); }
/** * @param \ride\application\orm\entry\ImageTransformationEntry $entry * @return null */ public function removeFromTransformations(AliasImageTransformationEntry $entry) { $this->getTransformations(); $status = false; foreach ($this->transformations as $transformationsIndex => $transformationsValue) { if ($transformationsValue === $entry || $transformationsValue->getId() === $entry->getId()) { unset($this->transformations[$transformationsIndex]); $status = true; break; } } if ($status && $this->entryState === self::STATE_CLEAN) { $this->entryState = self::STATE_DIRTY; } return $status; }