/**
  * Create a data container for the model
  * @param zibo\library\orm\model\meta\ModelMeta $meta the meta of the model
  * @param zibo\library\ObjectFactory $objectFactory factory for new objects
  * @param boolean $initialize set to true to get an object with default values, false to get an empty object
  * @return mixed a data container for the model
  */
 private function initData(ModelMeta $meta, ObjectFactory $objectFactory, $initialize)
 {
     $data = $objectFactory->create($meta->getDataClassName());
     if (!$initialize) {
         return $data;
     }
     $fields = $meta->getFields();
     foreach ($fields as $field) {
         $name = $field->getName();
         if ($field instanceof BelongsToField || $field instanceof HasOneField) {
             $data->{$name} = null;
             continue;
         }
         if ($field instanceof HasManyField) {
             $data->{$name} = array();
             continue;
         }
         $data->{$name} = $field->getDefaultValue();
     }
     return $data;
 }