summaryrefslogtreecommitdiff
path: root/protected/models
diff options
context:
space:
mode:
Diffstat (limited to 'protected/models')
-rw-r--r--protected/models/Angebot.php3
-rw-r--r--protected/models/Standort.php8
2 files changed, 9 insertions, 2 deletions
diff --git a/protected/models/Angebot.php b/protected/models/Angebot.php
index baa31b8..7791bcb 100644
--- a/protected/models/Angebot.php
+++ b/protected/models/Angebot.php
@@ -55,7 +55,8 @@ class Angebot extends CActiveRecord
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
- "kategorie"=>array(self::HAS_ONE, "Kategorie", array('id'=>'kategorie_id'))
+ "kategorie"=>array(self::HAS_ONE, "Kategorie", array('id'=>'kategorie_id')),
+ "angebot_vereine"=>array(self::HAS_MANY, "AngebotVerein", array('angebot_id'=>'id'))
);
}
diff --git a/protected/models/Standort.php b/protected/models/Standort.php
index cd4f284..48493f6 100644
--- a/protected/models/Standort.php
+++ b/protected/models/Standort.php
@@ -22,6 +22,11 @@ class Standort extends CActiveRecord
return parent::model($className);
}
+ public function afterConstruct() {
+ $this->pos_lat = Yii::app()->params['pos_lat'];
+ $this->pos_long = Yii::app()->params['pos_long'];
+ }
+
/**
* @return string the associated database table name
*/
@@ -38,6 +43,7 @@ class Standort extends CActiveRecord
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
+ array('name, pos_lat, pos_long', 'required'),
array('published', 'numerical', 'integerOnly'=>true),
array('pos_lat, pos_long', 'numerical'),
array('name', 'length', 'max'=>80),
@@ -68,7 +74,7 @@ class Standort extends CActiveRecord
'name' => 'Name',
'pos_lat' => 'Pos Lat',
'pos_long' => 'Pos Long',
- 'published' => 'Published',
+ 'published' => 'Öffentlich',
);
}