/**
  *  set i18n namespace to the table name
  */
 public function setValue($value, $record = null)
 {
     parent::setValue($value, $record);
     if (is_array($record)) {
         $record = (object) $record;
     }
     if ($record && !empty($record->ClassName)) {
         $this->DbObjectName = $record->ClassName;
     }
 }
 public function setValue($value, $record = null, $markChanged = true)
 {
     parent::setValue($value, $record, $markChanged);
     if ($record instanceof DataObject) {
         $this->record = $record;
     }
 }
Esempio n. 3
0
    public function testEnumProperty()
    {
        $enums = array('Yes','No');
        $valid = 'Yes';
        $invalid = 'Bob';

        $property = new Enum('AProperty', $enums, $valid);

        $this->assertEquals($enums, $property->getChoices());

        $property->setValue($valid);
        $this->assertEquals($valid, $property->getValue());

        $property->setValue($invalid);
        $this->assertNotEquals($invalid, $property->getValue());
    }
 /**
  * Set the value on the field.
  * Optionally takes the whole record as an argument,
  * to pick other values.
  *
  * @param mixed $value
  * @param array $record
  */
 public function setValue($value, $record = null)
 {
     FrontendEditing::setValue($this, $value, $record);
     parent::setValue($value, $record);
 }