Datatypes\CheckboxList\Editor::save PHP Method

save() public method

Save checkbox list editor
public save ( ) : void
return void
    public function save()
    {
        $data = $this->getRequest()->getPost()->get($this->getName());
        if (!empty($data)) {
            $data = serialize($data);
        }
        $this->setValue($data);
    }

Usage Example

Example #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testSave()
 {
     $this->object->getRequest()->getPost()->set($this->object->getName(), '1');
     $this->object->save();
     $this->assertEquals('s:1:"1";', $this->object->getValue());
 }