/** * Задает значение атрибута * @param mixed $value */ public function setValue($value) { parent::setValue($value); $val = $this->getValue(); $val = (double) str_replace(array(' ', ','), array('', '.'), $val); parent::setValue($val); }
/** * Задает значение атрибута * @param mixed $value */ public function setValue($value) { $toSet = null; if ($value !== null && $value !== '') { $list = $this->getListItems(); //перебираем все id foreach ($list as $item) { if ($item['ID'] == $value) { $toSet = $item['ID']; break; } } //перебираем все xml_id if ($toSet === null) { foreach ($list as $item) { if ($item['XML_ID'] == $value) { $toSet = $item['ID']; break; } } } //перебираем все значения if ($toSet === null) { foreach ($list as $item) { if ($item['VALUE'] == $value) { $toSet = $item['ID']; break; } } } } parent::setValue($toSet); }
/** * Задает значение атрибута * @param mixed $value */ public function setValue($value) { if (is_array($value)) { $value = array_diff(array_map('intval', $value), array(0)); } elseif (($id = intval($value)) !== 0) { $value = array($id); } parent::setValue($value); }
/** * Задает значение атрибута * @param mixed $value */ public function setValue($value) { /* fix at multiply property */ if (is_array($value) && isset($value['VALUE'])) { $value = $value['VALUE']; } /* fix end */ $toSet = null; if ($value !== null && $value !== '') { $list = $this->getListItems(); //перебираем все id foreach ($list as $item) { if ($item['ID'] == $value) { $toSet = $item['ID']; break; } } //перебираем все xml_id if ($toSet === null) { foreach ($list as $item) { if ($item['XML_ID'] == $value) { $toSet = $item['ID']; break; } } } //перебираем все значения if ($toSet === null) { foreach ($list as $item) { if ($item['VALUE'] == $value) { $toSet = $item['ID']; break; } } } } parent::setValue($toSet); }
/** * Задает значение атрибута * @param mixed $value */ public function setValue($value) { if ($value === null || $value === array()) { return parent::setValue(array()); } $values = parent::getValue(); $values = is_array($values) ? $values : array(); $value = is_array($value) ? array_values($value) : array($value); foreach ($values as $key => $element) { if (array_key_exists($key, $value)) { $element->setValue($value[$key]); } else { unset($values[$key]); } } foreach ($value as $key => $val) { if (!isset($values[$key])) { $values[$key] = $this->initValueItem($key); $values[$key]->setValue($val); } } return parent::setValue($values); }
public function setValue($value) { $value = rawurldecode($value); return parent::setValue($value); }
/** * Задает значение атрибута * @param mixed $value */ public function setValue($value) { $this->_path = null; parent::setValue($value); }
public function parseNode() { $this->next(); if ($this->current() == "!") { $node = $this->parseComment(); } else { $this->skipWhiteSpaces(); $nodeName = $this->parseName(); $this->skipWhiteSpaces(); $node = new Element($nodeName); while ($this->current() != ">" && $this->current() != "/") { $this->skipWhiteSpaces(); $attrName = $this->parseName(); $attr = new Attribute($attrName); $this->skipWhiteSpaces(); if ($this->current() == "=") { $this->next(); $this->skipWhiteSpaces(); $value = $this->parseQuoted(); $attr->setValue($value); } $node->addAttribute($attr); } $this->skipWhiteSpaces(); if ($this->current() == "/") { $this->next(); if ($this->current() == ">") { $this->next(); } } else { $this->next(); if (!in_array(strtolower($nodeName), $this->noEndNodes)) { $this->parseBody($node); } } } return $node; }
/** * Задает значение атрибута * @param mixed $value */ public function setValue($value) { $this->_related = null; parent::setValue($value); }
/** * Задает значение атрибута * @param mixed $value */ public function setValue($value) { $value = $value && $value !== 'N' ? 'Y' : 'N'; parent::setValue($value); }