/** * @return array */ public function toArray() { $data = parent::toArray(); if ($this->crop) { $data['crop'] = $this->crop->toArray(); } else { unset($data['crop']); } $data[self::TOKEN_DIMENSION] = '' . $this->getDimension(); return $data; }