Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/atom/DivinerAtom.php
Show First 20 Lines • Show All 316 Lines • ▼ Show 20 Lines | return array( | ||||
'extends' => $this->getExtendsDictionaries(), | 'extends' => $this->getExtendsDictionaries(), | ||||
'links' => $this->getLinkDictionaries(), | 'links' => $this->getLinkDictionaries(), | ||||
'ref' => $this->getRef()->toDictionary(), | 'ref' => $this->getRef()->toDictionary(), | ||||
'properties' => $this->getProperties(), | 'properties' => $this->getProperties(), | ||||
); | ); | ||||
} | } | ||||
public function getRef() { | public function getRef() { | ||||
$title = null; | $display_name = null; | ||||
if ($this->docblockMeta) { | if ($this->docblockMeta) { | ||||
$title = $this->getDocblockMetaValue('title'); | $display_name = $this->getDocblockMetaValue('title'); | ||||
} | } | ||||
return id(new DivinerAtomRef()) | return id(new DivinerAtomRef()) | ||||
->setBook($this->getBook()) | ->setBook($this->getBook()) | ||||
->setContext($this->getContext()) | ->setContext($this->getContext()) | ||||
->setType($this->getType()) | ->setType($this->getType()) | ||||
->setName($this->getName()) | ->setName($this->getName(), $display_name) | ||||
->setTitle($title) | |||||
->setGroup($this->getProperty('group')); | ->setGroup($this->getProperty('group')); | ||||
} | } | ||||
public static function newFromDictionary(array $dictionary) { | public static function newFromDictionary(array $dictionary) { | ||||
$atom = id(new DivinerAtom()) | $atom = id(new DivinerAtom()) | ||||
->setBook(idx($dictionary, 'book')) | ->setBook(idx($dictionary, 'book')) | ||||
->setType(idx($dictionary, 'type')) | ->setType(idx($dictionary, 'type')) | ||||
->setName(idx($dictionary, 'name')) | ->setName(idx($dictionary, 'name')) | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |