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->AddService($server, WebServices::AllCustomAttributes, array(WebServiceParams::AttributeCategoryId => $this->categoryId)); $this->AddService($server, WebServices::GetCustomAttribute, array(WebServiceParams::AttributeId => $this->id)); }
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)); }
/** * @return boolean */ public function Required() { return $this->attributeDefinition->Required(); }
/** * @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())); }