Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/storage/AlmanacService.php
| Show All 11 Lines | final class AlmanacService | ||||
| protected $name; | protected $name; | ||||
| protected $nameIndex; | protected $nameIndex; | ||||
| protected $mailKey; | protected $mailKey; | ||||
| protected $viewPolicy; | protected $viewPolicy; | ||||
| protected $editPolicy; | protected $editPolicy; | ||||
| private $customFields = self::ATTACHABLE; | private $customFields = self::ATTACHABLE; | ||||
| private $almanacProperties = self::ATTACHABLE; | private $almanacProperties = self::ATTACHABLE; | ||||
| private $bindings = self::ATTACHABLE; | |||||
| public static function initializeNewService() { | public static function initializeNewService() { | ||||
| return id(new AlmanacService()) | return id(new AlmanacService()) | ||||
| ->setViewPolicy(PhabricatorPolicies::POLICY_USER) | ->setViewPolicy(PhabricatorPolicies::POLICY_USER) | ||||
| ->setEditPolicy(PhabricatorPolicies::POLICY_ADMIN) | ->setEditPolicy(PhabricatorPolicies::POLICY_ADMIN) | ||||
| ->attachAlmanacProperties(array()); | ->attachAlmanacProperties(array()); | ||||
| } | } | ||||
| Show All 32 Lines | public function save() { | ||||
| return parent::save(); | return parent::save(); | ||||
| } | } | ||||
| public function getURI() { | public function getURI() { | ||||
| return '/almanac/service/view/'.$this->getName().'/'; | return '/almanac/service/view/'.$this->getName().'/'; | ||||
| } | } | ||||
| public function getBindings() { | |||||
| return $this->assertAttached($this->bindings); | |||||
| } | |||||
| public function attachBindings(array $bindings) { | |||||
| $this->bindings = $bindings; | |||||
| return $this; | |||||
| } | |||||
| /* -( AlmanacPropertyInterface )------------------------------------------- */ | /* -( AlmanacPropertyInterface )------------------------------------------- */ | ||||
| public function attachAlmanacProperties(array $properties) { | public function attachAlmanacProperties(array $properties) { | ||||
| assert_instances_of($properties, 'AlmanacProperty'); | assert_instances_of($properties, 'AlmanacProperty'); | ||||
| $this->almanacProperties = mpull($properties, null, 'getFieldName'); | $this->almanacProperties = mpull($properties, null, 'getFieldName'); | ||||
| return $this; | return $this; | ||||
| ▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines | |||||