getList() public method

Get the list
public getList ( ) : array
return array
Example #1
0
 /**
  * @covers Imbo\Model\ListModel::setList
  * @covers Imbo\Model\ListModel::getList
  */
 public function testCanSetAndGetAList()
 {
     $this->assertSame([], $this->model->getList());
     $list = [1, 2, 3];
     $this->assertSame($this->model, $this->model->setList($list));
     $this->assertSame($list, $this->model->getList());
 }
Example #2
0
 /**
  * @covers Imbo\Model\ListModel::setList
  * @covers Imbo\Model\ListModel::getList
  */
 public function testCanSetAndGetAList()
 {
     $this->assertSame(array(), $this->model->getList());
     $list = array(1, 2, 3);
     $this->assertSame($this->model, $this->model->setList($list));
     $this->assertSame($list, $this->model->getList());
 }
Example #3
0
File: XML.php Project: ASP96/imbo
    /**
     * {@inheritdoc}
     */
    public function formatListModel(Model\ListModel $model)
    {
        $data = '';
        $entries = '';
        $container = $model->getContainer();
        $entry = $model->getEntry();
        $list = $model->getList();
        foreach ($list as $element) {
            $entries .= '<' . $entry . '>' . $element . '</' . $entry . '>';
        }
        $data = '<' . $container . '>' . $entries . '</' . $container . '>';
        return <<<DATA
<?xml version="1.0" encoding="UTF-8"?>
<imbo>{$data}</imbo>
DATA;
    }
Example #4
0
File: JSON.php Project: ASP96/imbo
 /**
  * {@inheritdoc}
  */
 public function formatListModel(Model\ListModel $model)
 {
     return $this->encode(array($model->getContainer() => $model->getList()));
 }