/** * sets record related properties * * @param string _name of property * @param mixed _value of property * @throws Tinebase_Exception_InvalidArgument */ public function __set($_name, $_value) { switch ($_name) { case 'application_id': $_value = Tinebase_Model_Application::convertApplicationIdToInt($_value); } parent::__set($_name, $_value); }
/** * sets record related properties * * @param string _name of property * @param mixed _value of property * @throws Tinebase_Exception_InvalidArgument */ public function __set($_name, $_value) { switch ($_name) { case 'application_id': $_value = Tinebase_Model_Application::convertApplicationIdToInt($_value); } /** * @TODO * - ask model for datatype * - cope with record/recordSet */ if (is_string($_value) && strlen($_value) == 19 && preg_match('/^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$/', $_value)) { $_value = new Tinebase_DateTime($_value); } parent::__set($_name, $_value); }
/** * set properties and convert them into internal representatin on the fly * * @param string $_name * @param mixed $_value * @return void */ public function __set($_name, $_value) { switch ($_name) { case 'until': if (!empty($_value)) { if ($_value instanceof DateTime) { $this->_properties['until'] = $_value; } else { $this->_properties['until'] = new Tinebase_DateTime($_value); } } break; case 'bymonth': case 'bymonthday': if (!empty($_value)) { $values = explode(',', $_value); $this->_properties[$_name] = (int) $values[0]; } break; default: parent::__set($_name, $_value); break; } }
/** * sets record related properties * * @param string _name of property * @param mixed _value of property * @throws Tinebase_Exception_UnexpectedValue * @return void */ public function __set($_name, $_value) { // ensure exdate as array if ($_name == 'exdate' && !empty($_value) && !is_array($_value) && !$_value instanceof Tinebase_Record_RecordSet) { $_value = array($_value); } if ($_name == 'attendee' && is_array($_value)) { $_value = new Tinebase_Record_RecordSet('Calendar_Model_Attender', $_value); } if ($_name == 'rrule' && is_string($_value) && !empty($_value)) { // normalize rrule $_value = new Calendar_Model_Rrule($_value); $_value = (string) $_value; } parent::__set($_name, $_value); }
/** * (non-PHPdoc) * @see Tinebase_Record_Abstract::__set() */ public function __set($_name, $_value) { if ($_name == 'ics') { unset($this->event); } if ($_name == 'method') { $_value = trim(strtoupper($_value)); } return parent::__set($_name, $_value); }
/** * Overwrites the __set Method from Tinebase_Record_Abstract * Also sets n_fn and n_fileas when org_name, n_given or n_family should be set * @see Tinebase_Record_Abstract::__set() * @param string $_name of property * @param mixed $_value of property */ public function __set($_name, $_value) { switch ($_name) { case 'n_given': $resolved = $this->_resolveAutoValues(array('n_given' => $_value, 'n_family' => $this->__get('n_family'), 'org_name' => $this->__get('org_name'))); parent::__set('n_fn', $resolved['n_fn']); parent::__set('n_fileas', $resolved['n_fileas']); break; case 'n_family': $resolved = $this->_resolveAutoValues(array('n_family' => $_value, 'n_given' => $this->__get('n_given'), 'org_name' => $this->__get('org_name'))); parent::__set('n_fn', $resolved['n_fn']); parent::__set('n_fileas', $resolved['n_fileas']); break; case 'org_name': $resolved = $this->_resolveAutoValues(array('org_name' => $_value, 'n_given' => $this->__get('n_given'), 'n_family' => $this->__get('n_family'))); parent::__set('n_fn', $resolved['n_fn']); parent::__set('n_fileas', $resolved['n_fileas']); break; default: // normalize telephone numbers if (!empty($_value) && strpos($_name, 'tel_') === 0 && strpos($_name, '_normalized') === false) { parent::__set($_name . '_normalized', static::normalizeTelephoneNoCountry($_value)); } break; } parent::__set($_name, $_value); }
/** * Overwrites the __set Method from Tinebase_Record_Abstract * Also sets n_fn and n_fileas when org_name, n_given or n_family should be set * @see Tinebase_Record_Abstract::__set() */ public function __set($_name, $_value) { switch ($_name) { case 'n_given': $resolved = $this->_resolveAutoValues(array('n_given' => $_value, 'n_family' => $this->__get('n_family'), 'org_name' => $this->__get('org_name'))); parent::__set('n_fn', $resolved['n_fn']); parent::__set('n_fileas', $resolved['n_fileas']); break; case 'n_family': $resolved = $this->_resolveAutoValues(array('n_family' => $_value, 'n_given' => $this->__get('n_given'), 'org_name' => $this->__get('org_name'))); parent::__set('n_fn', $resolved['n_fn']); parent::__set('n_fileas', $resolved['n_fileas']); break; case 'org_name': $resolved = $this->_resolveAutoValues(array('org_name' => $_value, 'n_given' => $this->__get('n_given'), 'n_family' => $this->__get('n_family'))); parent::__set('n_fn', $resolved['n_fn']); parent::__set('n_fileas', $resolved['n_fileas']); } parent::__set($_name, $_value); }