Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / View / Helper / ViewModel.php
blobf183df3967bd8ec9cb83a41b07a3e4538384739c
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\View\Helper;
12 use Zend\View\Model\ModelInterface as Model;
14 /**
15 * Helper for storing and retrieving the root and current view model
17 class ViewModel extends AbstractHelper
19 /**
20 * @var Model
22 protected $current;
24 /**
25 * @var Model
27 protected $root;
29 /**
30 * Set the current view model
32 * @param Model $model
33 * @return ViewModel
35 public function setCurrent(Model $model)
37 $this->current = $model;
38 return $this;
41 /**
42 * Get the current view model
44 * @return null|Model
46 public function getCurrent()
48 return $this->current;
51 /**
52 * Is a current view model composed?
54 * @return bool
56 public function hasCurrent()
58 return ($this->current instanceof Model);
61 /**
62 * Set the root view model
64 * @param Model $model
65 * @return ViewModel
67 public function setRoot(Model $model)
69 $this->root = $model;
70 return $this;
73 /**
74 * Get the root view model
76 * @return null|Model
78 public function getRoot()
80 return $this->root;
83 /**
84 * Is a root view model composed?
86 * @return bool
88 public function hasRoot()
90 return ($this->root instanceof Model);