getData() public method

public getData ( )
Exemplo n.º 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());
 }
Exemplo n.º 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());
 }
Exemplo n.º 3
0
Arquivo: XML.php Projeto: ASP96/imbo
    /**
     * {@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;
    }
Exemplo n.º 4
0
Arquivo: JSON.php Projeto: ASP96/imbo
 /**
  * {@inheritdoc}
  */
 public function formatArrayModel(Model\ArrayModel $model)
 {
     return $this->encode($model->getData() ?: new stdClass());
 }