$blog =
new Blog();
$blog->
setId((int) $data['__blog_id'
]);
$blog->
setTitle($data['__blog_title'
]);
$blog->
setAuthorId($data['__blog_author_id'
] !== null ?
(int) $data['__blog_author_id'
] : null
);
$blog->
setActive((bool) $data['__blog_active'
]);
$blog->
setShortDescription($data['__blog_short_description'
]);
$blog->
setDescription($data['__blog_description'
]);
$blog->
setViews((int) $data['__blog_views'
]);
$blog->
setDisplayDate($data['__blog_display_date'
] ?
date_create($data['__blog_display_date'
]) : null
);
$blog->
setCategoryId((int) $data['__blog_category_id'
]);
$blog->
setTemplate($data['__blog_template'
]);
$blog->
setMetaKeywords($data['__blog_meta_keywords'
]);
$blog->
setMetaDescription($data['__blog_meta_description'
]);
$blog->
setMetaTitle($data['__blog_meta_title'
]);
if (isset($data['__blogAttribute_id'
])) { $attributeData =
$this->
extractFields('__blogAttribute_',
$data);
$attribute =
$this->attributeHydrator->
hydrate($attributeData);
$blog->
addAttribute('core',
$attribute);
}