root/trunk/midcom/midcom.helper.schemaapi/field.php

Revision 14086, 1.5 kB (checked in by flack, 8 months ago)

phpdoc fixes 3

Line 
1 <?php
2 /**
3  * @package midcom.helper.schemaapi
4  * @author The Midgard Project, http://www.midgard-project.org
5  * @copyright The Midgard Project, http://www.midgard-project.org
6  * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
7  */
8
9 /**
10  * @package midcom.helper.schemaapi
11  */
12 class midcom_helper_schemaapi_field
13 {
14     protected $name;
15     protected $storage;
16     protected $title;
17     protected $widget;
18     protected $type;
19
20     public function __construct ( $name, $storage, $title )
21     {
22         $this->name = $name;
23         $this->storage = $storage;
24         $this->title = $title;
25     }
26
27
28     public function set_type ( $type ) {
29
30         $this->type = $type;
31     }
32
33     public function set_widget ( $widget ) {
34         $this->widget = $widget;
35     }
36
37     public function asArray(  ) {
38         $ret = array(  );
39         $ret[$this->name] = array(
40                 'title' => $this->title,
41                 'storage' => $this->storage,
42                 'type' => $this->type->get_name(  ),
43                 //'type_config' => $this->type->get_config(  ),
44                 'widget' => $this->widget->get_name(  ),
45                 //'widget_config' => $this->widget->get_config( ) ,
46                 );
47         if ( count ( $this->widget->get_config(  ) ) > )
48         {
49             $ret[$this->name]['widget_config'] = $this->widget->get_config(  );
50         }
51         if ( count ( $this->type->get_config(  ) ) )
52         {
53             $ret[$this->name]['type_config'] = $this->type->get_config(  );
54         }
55         return $ret;
56     }
57 }
58
Note: See TracBrowser for help on using the browser.