Imbo\Http\Response\Response::setModel PHP 메소드

setModel() 공개 메소드

Set the model instance
public setModel ( Imbo\Model\ModelInterface $model = null ) : Response
$model Imbo\Model\ModelInterface A model instance
리턴 Response
    public function setModel(Model\ModelInterface $model = null)
    {
        $this->model = $model;
        return $this;
    }

Usage Example

예제 #1
0
파일: ResponseTest.php 프로젝트: ASP96/imbo
 /**
  * @covers Imbo\Http\Response\Response::setModel
  * @covers Imbo\Http\Response\Response::setNotModified
  */
 public function testRemovesModelWhenMarkedAsNotModified()
 {
     $model = $this->getMock('Imbo\\Model\\ModelInterface');
     $this->assertSame($this->response, $this->response->setModel($model));
     $this->assertSame($this->response, $this->response->setNotModified());
     $this->assertSame(304, $this->response->getStatusCode());
     $this->assertNull($this->response->getModel());
 }