Source of file ClassObject.php
Size: 1,584 Bytes - Last Modified: 2021-12-23T10:39:20+00:00
/var/www/docs.ssmods.com/process/src/src/View/ClassObject.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 | <?php namespace Sunnysideup\BuildDataObject\View; use SilverStripe\Core\ClassInfo; use SilverStripe\Core\Config\Configurable; use SilverStripe\Core\Extensible; use SilverStripe\Core\Injector\Injectable; use SilverStripe\View\ViewableData; class ClassObject extends ViewableData { // use Configurable; // use Extensible; // use Injectable; protected $fullName = ''; public function __construct($fullName) { $this->fullName = $fullName; } public function FullName() { return $this->getFullName(); } public function getFullName() { return $this->fullName; } public function ShortName() { return $this->getShortName(); } public function getShortName() { $shortName = ''; if (class_exists($this->fullName)) { $shortName = ClassInfo::shortName($this->fullName); } else { $array = explode('\\', $this->fullName); if (count($array) > 1) { $shortName = end($array); } } if ($shortName) { return $shortName; } return $this->fullName; } public function isClass() { if (class_exists($this->fullName)) { return true; } if (class_exists('\\' . $this->fullName)) { return true; } $array = explode('\\', $this->fullName); if (count($array) > 1) { return true; } } public function forTemplate() { return $this->fullName; } } |