/** * @param modelBase $area * * @throws \mpcmf\modules\moduleBase\exceptions\modelException * @return \mpcmf\modules\moduleBase\models\modelCursor */ public function getGeoByArea(modelBase $area) { return $this->getGeoByAreaId($area->getIdValue()); }
/** * @param modelBase|userModel $user * * @return array * @throws modelException */ public function buildCookieDataByUser(modelBase $user) { return ['id' => $user->getIdValue(), 'name' => $user->getFirstName(), 'groups' => $user->getGroupIds(), 'email' => $user->getEmail()]; }
public function convertDataFromForm($input, modelBase $model = null) { $result = []; foreach ($input as $field => $value) { $converted = $this->convert($field, $value); if ($model !== null && $model->getFieldValue($field) === $value) { $result[$field] = $value; continue; } $result[$field] = $converted; } return $result; }