예제 #1
0
 /**
  * @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());
 }
예제 #2
0
 /**
  * @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()];
 }
예제 #3
0
 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;
 }