public function __construct(IRestServer $server, CustomAttribute $attribute)
 {
     $this->id = $attribute->Id();
     $this->categoryId = $attribute->Category();
     $this->label = $attribute->Label();
     $this->possibleValues = $attribute->PossibleValueList();
     $this->regex = $attribute->Regex();
     $this->required = $attribute->Required();
     $this->type = $attribute->Type();
     $this->sortOrder = $attribute->SortOrder();
     $this->appliesToId = $attribute->EntityId();
     $this->AddService($server, WebServices::AllCustomAttributes, array(WebServiceParams::AttributeCategoryId => $this->categoryId));
     $this->AddService($server, WebServices::GetCustomAttribute, array(WebServiceParams::AttributeId => $this->id));
     $this->AddService($server, WebServices::UpdateCustomAttribute, array(WebServiceParams::AttributeId => $this->id));
     $this->AddService($server, WebServices::DeleteCustomAttribute, array(WebServiceParams::AttributeId => $this->id));
 }
Пример #2
0
 /**
  * @return int
  */
 public function SortOrder()
 {
     return $this->attributeDefinition->SortOrder();
 }
Пример #3
0
 /**
  * @param CustomAttribute $attribute
  */
 public function Update(CustomAttribute $attribute)
 {
     ServiceLocator::GetDatabase()->Execute(new UpdateAttributeCommand($attribute->Id(), $attribute->Label(), $attribute->Type(), $attribute->Category(), $attribute->Regex(), $attribute->Required(), $attribute->PossibleValues(), $attribute->SortOrder(), $attribute->EntityId()));
 }