public function setField($RowID, $Property, $Value = false)
{
if (!is_array($Property)) {
$Property = [$Property => $Value];
}
$this->defineSchema();
$Fields = $this->Schema->fields();
$Set = array_intersect_key($Property, $Fields);
self::serializeRow($Set);
$this->SQL->update($this->Name)->set($Set)->where('UserID', $RowID)->put();
if (in_array($Property, ['Permissions'])) {
$this->clearCache($RowID, ['permissions']);
} else {
$this->updateUserCache($RowID, $Property, $Value);
}
if (!is_array($Property)) {
$Property = [$Property => $Value];
}
$this->EventArguments['UserID'] = $RowID;
$this->EventArguments['Fields'] = $Property;
$this->fireEvent('AfterSetField');
return $Value;
}