1 | <?php |
||
19 | class TbEditableDetailView extends CDetailView |
||
20 | { |
||
21 | |||
22 | public function init() |
||
23 | { |
||
24 | if (!$this->data instanceof CModel) { |
||
|
|||
25 | throw new CException('Property "data" should be of CModel class.'); |
||
26 | } |
||
27 | |||
28 | //set bootstrap css |
||
29 | /* TODO if(yii::app()->editable->form === 'bootstrap') { */ |
||
30 | $this->htmlOptions = array('class'=> 'table table-bordered table-striped table-hover'); |
||
31 | //disable loading Yii's css for bootstrap |
||
32 | $this->cssFile = false; |
||
33 | // } |
||
34 | |||
35 | parent::init(); |
||
36 | } |
||
37 | |||
38 | protected function renderItem($options, $templateData) |
||
76 | |||
77 | //*************************************************************************************** |
||
78 | // Generic getter/setter implementation to accept default configuration for TbEditableField |
||
79 | //*************************************************************************************** |
||
80 | |||
81 | /** Data for default fields of TbEditableField */ |
||
82 | private $_data = array(); |
||
83 | /** Valid attributes for TbEditableField (singleton) */ |
||
84 | private $_editableProperties; |
||
85 | |||
86 | /** |
||
87 | * Get the properties available for {@link TbEditableField}. |
||
88 | * |
||
89 | * These properties can also be set for the {@link TbEditableDetailView} as default values. |
||
90 | */ |
||
91 | private function getEditableProperties() |
||
92 | { |
||
93 | if(!isset($this->_editableProperties)) |
||
94 | { |
||
95 | $reflection = new ReflectionClass('TbEditableField'); |
||
96 | $this->_editableProperties = array_map( |
||
97 | function(ReflectionProperty $d) { return $d->getName(); }, |
||
98 | $reflection->getProperties() |
||
99 | ); |
||
100 | } |
||
101 | return $this->_editableProperties; |
||
102 | } |
||
103 | |||
104 | /** |
||
105 | * (non-PHPdoc) |
||
106 | * @see CComponent::__get() |
||
107 | * |
||
108 | * @param string $key |
||
109 | * |
||
110 | * @throws CException |
||
111 | * @return mixed |
||
112 | */ |
||
113 | public function __get($key) { |
||
116 | |||
117 | /** |
||
118 | * (non-PHPdoc) |
||
119 | * @see CComponent::__set() |
||
120 | * |
||
121 | * @param string $key |
||
122 | * @param mixed $value |
||
123 | * |
||
124 | * @throws CException |
||
125 | * @return mixed|void |
||
126 | */ |
||
127 | public function __set($key, $value) { |
||
134 | |||
135 | /** |
||
136 | * (non-PHPdoc) |
||
137 | * @see CComponent::__isset() |
||
138 | * |
||
139 | * @param string $name |
||
140 | * |
||
141 | * @return bool |
||
142 | */ |
||
143 | public function __isset($name) { |
||
146 | } |
||
147 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.