public function assign($data, $whiteList = null)
{
foreach ($this->modelsMetadata->getAttributes($this) as $attribute) {
if (!isset($data[$attribute])) {
continue;
}
if ($whiteList !== null && !in_array($attribute, $whiteList, true)) {
continue;
}
$this->{$attribute} = $data[$attribute];
}
return $this;
}