Source of file EditableFieldPageTypeList.php
Size: 0,579 Bytes - Last Modified: 2021-12-23T10:19:50+00:00
/var/www/docs.ssmods.com/process/src/code/extensions/editablefields/EditableFieldPageTypeList.php
123456789101112131415161718192021222324252627282930 | <?php /** * @author Mohamed Alsharaf <mohamed.alsharaf@gmail.com> */ class EditableFieldPageTypeListExtension extends DataExtension { /** * Get field value that is suitable for the view template file. * * @return Page */ public function getViewValue() { return Page::get()->byID((int) $this->owner->Value); } /** * Get string value of a field. * * @return null|string */ public function getValueAsString() { $page = $this->getViewValue(); return $page ? $page->Title : ''; } } |