Example #1
0
 public function save(Ot_Var_Abstract $var)
 {
     $model = new Ot_Model_DbTable_Config();
     $thisVar = $model->find($var->getName());
     $data = array('varName' => $var->getName(), 'value' => $var->getRawValue());
     if (is_null($thisVar)) {
         $model->insert($data);
     } else {
         $model->update($data, null);
     }
 }
Example #2
0
 public function save(Ot_Var_Abstract $var, $accountId)
 {
     $model = new Ot_Model_DbTable_AccountAttribute();
     $where = $model->getAdapter()->quoteInto('varName = ?', $var->getName()) . ' AND ' . $model->getAdapter()->quoteInto('accountId = ?', $accountId);
     $thisVar = $model->fetchAll($where);
     $data = array('accountId' => $accountId, 'varName' => $var->getName(), 'value' => $var->getRawValue());
     if ($thisVar->count() == 0) {
         $model->insert($data);
     } else {
         $model->update($data, $where);
     }
 }
Example #3
0
 public function saveAttribute(Ot_Var_Abstract $var, $hostParentId, $attributeId)
 {
     $model = new Ot_Model_DbTable_CustomAttributeValue();
     $where = $model->getAdapter()->quoteInto('hostParentId = ?', $hostParentId) . ' AND ' . $model->getAdapter()->quoteInto('hostKey = ?', $this->getKey()) . ' AND ' . $model->getAdapter()->quoteInto('attributeId = ?', $attributeId);
     $thisVar = $model->fetchAll($where);
     $data = array('hostParentId' => $hostParentId, 'hostKey' => $this->getKey(), 'attributeId' => $attributeId, 'value' => $var->getRawValue());
     if ($thisVar->count() == 0) {
         $model->insert($data);
     } else {
         $model->update($data, $where);
     }
 }
Example #4
0
 public function getValue()
 {
     $value = unserialize(parent::getValue());
     if (isset($value['password'])) {
         $value['password'] = $this->_decrypt($value['password']);
     }
     return $value;
 }
Example #5
0
 public function getValue()
 {
     return $this->_decrypt(parent::getValue());
 }
Example #6
0
 public function getValue()
 {
     return unserialize(parent::getValue());
 }
Example #7
0
 public function getDisplayValue()
 {
     return nl2br(parent::getDisplayValue());
 }