Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Traits;
- /**
- * Trait Thumbnails
- * @package App\Traits
- */
- trait Thumbnails
- {
- /**
- * @desc Method for setting a thumbnail for use in GridFields.
- * @note: Don't tell Stevie.
- * @return string
- */
- protected function getCMSThumbnail()
- {
- if ($this->ImageID && $image = $this->Image()) {
- if ($image->exists()) {
- return $image->Fill(60, 40);
- }
- }
- return '(none)';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement