public function set($sPropName, $sPropValue) { if ($sPropName === "password" || $sPropName === "passwordconfirm") { # Special handling for password and passwordconfirm if ($sPropName === "password" && $sPropValue !== "") { parent::set("digesta1", $this->getPasswordHashForPassword($sPropValue)); } return $this; } try { # does the property exist on the model object ? parent::set($sPropName, $sPropValue); } catch (\Exception $e) { # no, it may belong to the oIdentityPrincipal model object $this->oIdentityPrincipal->set($sPropName, $sPropValue); } return $this; }
public function set($sPropName, $sValue) { if ($sPropName === "todos") { if (($sComponents = $this->get("components")) !== "") { $aComponents = explode(",", $sComponents); } else { $aComponents = array(); } if ($sValue === TRUE) { if (!in_array("VTODO", $aComponents)) { $aComponents[] = "VTODO"; } } else { if (in_array("VTODO", $aComponents)) { unset($aComponents[array_search("VTODO", $aComponents)]); } } return parent::set("components", implode(",", $aComponents)); } if ($sPropName === "notes") { if (($sComponents = $this->get("components")) !== "") { $aComponents = explode(",", $sComponents); } else { $aComponents = array(); } if ($sValue === TRUE) { if (!in_array("VJOURNAL", $aComponents)) { $aComponents[] = "VJOURNAL"; } } else { if (in_array("VJOURNAL", $aComponents)) { unset($aComponents[array_search("VJOURNAL", $aComponents)]); } } return parent::set("components", implode(",", $aComponents)); } return parent::set($sPropName, $sValue); }