本文整理汇总了PHP中Tinebase_Record_Abstract::__set方法的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_Record_Abstract::__set方法的具体用法?PHP Tinebase_Record_Abstract::__set怎么用?PHP Tinebase_Record_Abstract::__set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tinebase_Record_Abstract
的用法示例。
在下文中一共展示了Tinebase_Record_Abstract::__set方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __set
/**
* 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);
}
示例2: __set
/**
* 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);
}
示例3: __set
/**
* 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;
}
}
示例4: __set
/**
* 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);
}
示例5: __set
/**
* (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);
}
示例6: __set
/**
* 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);
}
示例7: __set
/**
* 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);
}