@@ -36,7 +36,7 @@ public function __construct($identifier, $rowCount, $colCount) {
3636
3737 /**
3838 * {@inheritDoc}
39- * @see \Ajax\semantic\html\collections\table\ TableTrait::getTable()
39+ * @see TableTrait::getTable()
4040 */
4141 protected function getTable () {
4242 return $ this ;
@@ -147,15 +147,30 @@ public function newRow() {
147147 return $ this ->getBody ()->newRow ($ this ->_colCount );
148148 }
149149
150+ /**
151+ * Sets the tbody values
152+ * @param array $values values in an array of array
153+ * @return HtmlTable
154+ */
150155 public function setValues ($ values =array ()) {
151156 $ this ->getBody ()->setValues ($ values );
152157 return $ this ;
153158 }
154159
160+ /**
161+ * Sets the header values
162+ * @param array $values
163+ * @return HtmlTableContent
164+ */
155165 public function setHeaderValues ($ values =array ()) {
156166 return $ this ->getHeader ()->setValues ($ values );
157167 }
158168
169+ /**
170+ * Sets the footer values
171+ * @param array $values
172+ * @return HtmlTableContent
173+ */
159174 public function setFooterValues ($ values =array ()) {
160175 return $ this ->getFooter ()->setValues ($ values );
161176 }
@@ -186,14 +201,29 @@ public function addColVariations($colIndex, $variations=array()) {
186201 return $ this ->getBody ()->addColVariations ($ colIndex , $ variations );
187202 }
188203
204+ /**
205+ * Sets the col alignment to center
206+ * @param int $colIndex
207+ * @return HtmlTable
208+ */
189209 public function colCenter ($ colIndex ) {
190210 return $ this ->colAlign ($ colIndex , "colCenter " );
191211 }
192212
213+ /**
214+ * Sets the col alignment to right
215+ * @param int $colIndex
216+ * @return HtmlTable
217+ */
193218 public function colRight ($ colIndex ) {
194219 return $ this ->colAlign ($ colIndex , "colRight " );
195220 }
196221
222+ /**
223+ * Sets col alignment to left
224+ * @param int $colIndex
225+ * @return HtmlTable
226+ */
197227 public function colLeft ($ colIndex ) {
198228 return $ this ->colAlign ($ colIndex , "colLeft " );
199229 }
@@ -212,21 +242,43 @@ private function colAlign($colIndex, $function) {
212242 return $ this ;
213243 }
214244
245+ /**
246+ * Applies a format on each cell when $callback returns true
247+ * @param callable $callback function with the cell as parameter, must return a boolean
248+ * @param string $format css class to apply
249+ * @return HtmlTable
250+ */
215251 public function conditionalCellFormat ($ callback , $ format ) {
216252 $ this ->getBody ()->conditionalCellFormat ($ callback , $ format );
217253 return $ this ;
218254 }
219255
256+ /**
257+ * Applies a format on each row when $callback returns true
258+ * @param callable $callback function with the row as parameter, must return a boolean
259+ * @param string $format css class to apply
260+ * @return HtmlTable
261+ */
220262 public function conditionalRowFormat ($ callback , $ format ) {
221263 $ this ->getBody ()->conditionalRowFormat ($ callback , $ format );
222264 return $ this ;
223265 }
224266
267+ /**
268+ * Applies a callback function on each cell
269+ * @param callable $callback
270+ * @return HtmlTable
271+ */
225272 public function applyCells ($ callback ) {
226273 $ this ->getBody ()->applyCells ($ callback );
227274 return $ this ;
228275 }
229276
277+ /**
278+ * Applies a callback function on each row
279+ * @param callable $callback
280+ * @return HtmlTable
281+ */
230282 public function applyRows ($ callback ) {
231283 $ this ->getBody ()->applyRows ($ callback );
232284 return $ this ;
@@ -236,7 +288,7 @@ public function applyRows($callback) {
236288 *
237289 * {@inheritDoc}
238290 *
239- * @see \Ajax\semantic\html\base\ HtmlSemDoubleElement::compile()
291+ * @see HtmlSemDoubleElement::compile()
240292 */
241293 public function compile (JsUtils $ js =NULL , &$ view =NULL ) {
242294 if (\sizeof ($ this ->_compileParts )<3 ){
@@ -260,7 +312,7 @@ protected function compile_once(JsUtils $js=NULL, &$view=NULL) {
260312 *
261313 * {@inheritDoc}
262314 *
263- * @see \Ajax\common\html\ BaseHtml::fromDatabaseObject()
315+ * @see BaseHtml::fromDatabaseObject()
264316 */
265317 public function fromDatabaseObject ($ object , $ function ) {
266318 $ result =$ function ($ object );
@@ -277,7 +329,8 @@ public function fromDatabaseObject($object, $function) {
277329 }
278330
279331 /**
280- * @param array $parts
332+ * Sets the parts of the Table to compile
333+ * @param array $parts array of thead,tbody,tfoot
281334 * @return HtmlTable
282335 */
283336 public function setCompileParts ($ parts =["tbody " ]) {
@@ -308,6 +361,13 @@ public function onNewRow($callback) {
308361 return $ this ;
309362 }
310363
364+ /**
365+ * Defines how a row is selectable
366+ * @param string $class
367+ * @param string $event
368+ * @param boolean $multiple
369+ * @return HtmlTable
370+ */
311371 public function setActiveRowSelector ($ class ="active " ,$ event ="click " ,$ multiple =false ){
312372 $ this ->_activeRowSelector =new ActiveRow ($ this ,$ class ,$ event ,$ multiple );
313373 return $ this ;
0 commit comments