handle = $handle; return $this; } public function setQuery(PhabricatorSearchQuery $query) { $this->query = $query; return $this; } public function setObject($object) { $this->object = $object; return $this; } public function render() { $handle = $this->handle; if (!$handle->isComplete()) { return; } $type_name = nonempty($handle->getTypeName(), 'Document'); require_celerity_resource('phabricator-search-results-css'); $link = phutil_tag( 'a', array( 'href' => $handle->getURI(), ), PhabricatorEnv::getProductionURI($handle->getURI())); $img = $handle->getImageURI(); if ($img) { $img = phutil_tag( 'div', array( 'class' => 'result-image', 'style' => "background-image: url('{$img}');", ), ''); } switch ($handle->getType()) { case PhabricatorPHIDConstants::PHID_TYPE_CMIT: $object_name = $handle->getName(); if ($this->object) { $data = $this->object->loadOneRelative( new PhabricatorRepositoryCommitData(), 'commitID'); if ($data && strlen($data->getSummary())) { $object_name = $handle->getName().': '.$data->getSummary(); } } break; default: $object_name = $handle->getFullName(); break; } return '