getData() public method

public getData ( )
Beispiel #1
0
 /**
  * @covers Imbo\Model\ArrayModel::getData
  * @covers Imbo\Model\ArrayModel::setData
  */
 public function testCanSetAndGetData()
 {
     $this->assertSame([], $this->model->getData());
     $this->assertSame($this->model, $this->model->setData(['key' => 'value']));
     $this->assertSame(['key' => 'value'], $this->model->getData());
 }
Beispiel #2
0
 /**
  * @covers Imbo\Model\ArrayModel::getData
  * @covers Imbo\Model\ArrayModel::setData
  */
 public function testCanSetAndGetData()
 {
     $this->assertSame(array(), $this->model->getData());
     $this->assertSame($this->model, $this->model->setData(array('key' => 'value')));
     $this->assertSame(array('key' => 'value'), $this->model->getData());
 }
Beispiel #3
0
    /**
     * {@inheritdoc}
     */
    public function formatArrayModel(Model\ArrayModel $model)
    {
        $data = $this->formatArray($model->getData());
        return <<<DATA
<?xml version="1.0" encoding="UTF-8"?>
<imbo>{$data}</imbo>
DATA;
    }
Beispiel #4
0
 /**
  * {@inheritdoc}
  */
 public function formatArrayModel(Model\ArrayModel $model)
 {
     return $this->encode($model->getData() ?: new stdClass());
 }