Esempio n. 1
0
 public function getDataTypes(\SimplOn\Elements\Element &$element)
 {
     // @todo: check
     $result = array();
     $typesMap = array_reverse(self::$typesMap, true);
     foreach ($typesMap as $class => $type) {
         if ($attr_types = $element->attributesTypesWith('\\SimplOn\\Datas\\' . $class)) {
             //if($attr_types = $element->processData('doRead')) {
             // @todo: continue from here! (new instance_of :)
             if ($type == '_ForeignKey_') {
                 foreach ($attr_types as $attr) {
                     $encapsuledElement = $element->{'O' . $attr}()->element();
                     $encapsuledElementDatasTypes = $this->getDataTypes($encapsuledElement);
                     $result[$attr] = str_replace('auto_increment', '', $encapsuledElementDatasTypes[$encapsuledElement->field_id()]);
                 }
             } else {
                 $result = array_merge($result, array_combine($attr_types, array_fill(0, count($attr_types), $type)));
             }
         }
     }
     return $result;
 }