Path: blob/master/src/applications/almanac/engineextension/AlmanacBindingsSearchEngineAttachment.php
12256 views
<?php12final class AlmanacBindingsSearchEngineAttachment3extends AlmanacSearchEngineAttachment {45private $isActive;67public function setIsActive($is_active) {8$this->isActive = $is_active;9return $this;10}1112public function getIsActive() {13return $this->isActive;14}1516public function getAttachmentName() {17return pht('Almanac Bindings');18}1920public function getAttachmentDescription() {21return pht('Get Almanac bindings for the service.');22}2324public function willLoadAttachmentData($query, $spec) {25$query->needProperties(true);2627if ($this->getIsActive()) {28$query->needActiveBindings(true);29} else {30$query->needBindings(true);31}32}3334public function getAttachmentForObject($object, $data, $spec) {35$bindings = array();3637if ($this->getIsActive()) {38$service_bindings = $object->getActiveBindings();39} else {40$service_bindings = $object->getBindings();41}4243foreach ($service_bindings as $binding) {44$bindings[] = $this->getAlmanacBindingDictionary($binding);45}4647return array(48'bindings' => $bindings,49);50}5152}535455