public function getImageFile($offset, $conversionName = '')
{
/** @var Media $media */
- $media = $this->getMedia($offset)->get(0);
- return $media->getPath($conversionName);
+ $media = $this->getMedia($offset);
+ if (!$media) {
+ return null;
+ }
+ return $media->get(0)->getPath($conversionName);
}
+
public function getMediaURL($offset, $default = null)
{
return $this->getImageURL($offset, '', $default);
'can' => $this->_can, 'can_write' => $this->_canWrite, 'auth' => $this->_auth,
'database_type' => $this->_databaseType, 'database_unique' => $this->_databaseUnique, 'database_index' => $this->_databaseIndex, 'database_default' => $this->_databaseDefault, 'database_length' => $this->_databaseLength,
'fake' => false, 'store_in' => 'extras', 'attributes' => [],
- 'placeholder' => $this->_placeholder, 'pattern' => $this->_pattern,
+ 'placeholder' => $this->_placeholder, 'pattern' => $this->_pattern, 'class' => null,
];
}
protected function _getFieldAttributesKeys()
{
- return ['placeholder', 'rows', 'pattern'];
+ return ['placeholder', 'rows', 'pattern', 'class'];
}
protected function getFieldAttributes()