This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit test for HydratorAwareInterface
- Loading branch information
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Form | ||
*/ | ||
|
||
namespace ZendTest\Form\TestAsset; | ||
|
||
use Zend\Stdlib\Hydrator\HydratorAwareInterface; | ||
use Zend\Stdlib\Hydrator\HydratorInterface; | ||
use Zend\Stdlib\Hydrator\ClassMethods; | ||
|
||
class HydratorAwareModel implements HydratorAwareInterface | ||
{ | ||
protected $hydrator = null; | ||
|
||
protected $foo = null; | ||
protected $bar = null; | ||
|
||
public function setHydrator(HydratorInterface $hydrator) | ||
{ | ||
$this->hydrator = $hydrator; | ||
} | ||
|
||
public function getHydrator() | ||
{ | ||
if (!$this->hydrator) { | ||
$this->hydrator = new ClassMethods(); | ||
} | ||
return $this->hydrator; | ||
} | ||
|
||
public function setFoo($value) | ||
{ | ||
$this->foo = $value; | ||
return $this; | ||
} | ||
|
||
public function setBar($value) | ||
{ | ||
$this->bar = $value; | ||
return $this; | ||
} | ||
|
||
public function getFoo() | ||
{ | ||
return $this->foo; | ||
} | ||
|
||
public function getBar() | ||
{ | ||
return $this->bar; | ||
} | ||
} |