Source of file DataListExtension.php
Size: 0,593 Bytes - Last Modified: 2021-12-23T10:07:36+00:00
/var/www/docs.ssmods.com/process/src/code/extensions/DataListExtension.php
123456789101112131415161718192021222324 | <?php namespace Ntb\RestAPI; /** * Useful extensions for data lists. * @author Christian Blank <c.blank@notthatbad.net> */ class DataListExtension extends \Extension { /** * Returns the first element in a data list, that has the given url segment. * * Works in the same way as DataList::byID. * * @param string $url the url segment * @return \DataObject the object, that has the given url segment */ public function byURL($url) { $URL = \Convert::raw2sql($url); return $this->owner->filter('URLSegment', $URL)->first(); } } |