public function __construct(\stdClass $row = null) { $this->initializeAttributes(); if ($row) { foreach ((array) $row as $key => $value) { $this->attributes[$key] = $value; } } }