protected function _farmRole($from, $to, $action)
{
switch ($action) {
case static::ACT_CONVERT_TO_OBJECT:
/* @var $from Server */
$to->farmRole = ['id' => $from->farmRoleId];
break;
case static::ACT_CONVERT_TO_ENTITY:
/* @var $to Server */
$to->farmRoleId = ApiController::getBareId($from, 'farmRole');
break;
case static::ACT_GET_FILTER_CRITERIA:
return [['farmRoleId' => ApiController::getBareId($from, 'farmRole')]];
}
}