XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
XCube_Object.class.php
1<?php
11
12
18function S_PUBLIC_VAR( $definition ) {
19 $t_str = explode( ' ', trim( $definition ) );
20
21 return [ 'name' => trim( $t_str[1] ), 'type' => trim( $t_str[0] ) ];
22}
23
28 public $mProperty = [];
29
34 public function isArray() {
35 return false;
36 }
37
46 public function getPropertyDefinition() {
47 }
48
49 public function __construct() { //typo rename to fields
50 $fields = $this->getPropertyDefinition();
51 foreach ( $fields as $t_field ) {
52 $this->mProperty[ $t_field['name'] ] = [
53 'type' => $t_field['type'],
54 'value' => null
55 ];
56 }
57 }
58
62 public function prepare() {
63 }
64
65 public function toArray() {
66 $retArray = [];
67
68 foreach ( $this->mProperty as $t_key => $t_value ) {
69 $retArray[ $t_key ] = $t_value['value'];
70 }
71
72 return $retArray;
73 }
74
75 public function loadByArray( $vars ) {
76 foreach ( $vars as $t_key => $t_value ) {
77 if ( isset( $this->mProperty[ $t_key ] ) ) {
78 $this->mProperty[ $t_key ]['value'] = $t_value;
79 }
80 }
81 }
82}
83
85 public function isArray() {
86 return true;
87 }
88
93 public function getClassName() {
94 }
95}