diff options
| author | ccwn <tzur@ccwn.org> | 2012-04-24 18:49:57 +0200 |
|---|---|---|
| committer | ccwn <tzur@ccwn.org> | 2012-04-24 18:49:57 +0200 |
| commit | c98745edd2c7b2f48bc3493c4dd9a061376c4720 (patch) | |
| tree | ca1b559f220ec28c3f263d02a8b832613493471f /protected/models | |
| parent | 314328f527e8cae759d496f528a1472d7970c137 (diff) | |
- Database setup
- Database schema
- Database dev data
- config for new database setup
- Update in AngebotVerein
- Update in Speis&Trank
- Update in Verein
- Update in Kategorie
Diffstat (limited to 'protected/models')
| -rw-r--r-- | protected/models/Angebot.php | 1 | ||||
| -rw-r--r-- | protected/models/AngebotVerein.php | 18 | ||||
| -rw-r--r-- | protected/models/Standort.php | 8 | ||||
| -rw-r--r-- | protected/models/Verein.php | 4 |
4 files changed, 21 insertions, 10 deletions
diff --git a/protected/models/Angebot.php b/protected/models/Angebot.php index 7791bcb..9561687 100644 --- a/protected/models/Angebot.php +++ b/protected/models/Angebot.php @@ -38,6 +38,7 @@ class Angebot extends CActiveRecord // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( + array('name, kategorie_id', 'required'), array('kategorie_id, published', 'numerical', 'integerOnly'=>true), array('name', 'length', 'max'=>80), array('beschreibung', 'safe'), diff --git a/protected/models/AngebotVerein.php b/protected/models/AngebotVerein.php index 54cb734..65339ed 100644 --- a/protected/models/AngebotVerein.php +++ b/protected/models/AngebotVerein.php @@ -6,7 +6,8 @@ * The followings are the available columns in table 'angebot_verein': * @property integer $angebot_id * @property integer $verein_id - * @property integer $menge + * @property double $menge + * @property string $einheit * @property double $preis * @property integer $published */ @@ -38,12 +39,13 @@ class AngebotVerein extends CActiveRecord // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( - array('angebot_id, verein_id, menge', 'required'), - array('angebot_id, verein_id, menge, published', 'numerical', 'integerOnly'=>true), - array('preis', 'numerical'), + array('angebot_id, verein_id, menge, einheit, preis', 'required'), + array('angebot_id, verein_id, published', 'numerical', 'integerOnly'=>true), + array('menge, preis', 'numerical'), + array('einheit', 'length', 'max'=>20), // The following rule is used by search(). // Please remove those attributes that should not be searched. - array('angebot_id, verein_id, menge, preis, published', 'safe', 'on'=>'search'), + array('angebot_id, verein_id, menge, einheit, preis, published', 'safe', 'on'=>'search'), ); } @@ -55,6 +57,8 @@ class AngebotVerein extends CActiveRecord // NOTE: you may need to adjust the relation name and the related // class name for the relations automatically generated below. return array( + "angebot"=>array(self::HAS_ONE, "Angebot", array('id'=>'angebot_id')), + "verein"=>array(self::HAS_ONE, "Verein", array('id'=>'verein_id')) ); } @@ -67,8 +71,9 @@ class AngebotVerein extends CActiveRecord 'angebot_id' => 'Angebot', 'verein_id' => 'Verein', 'menge' => 'Menge', + 'einheit' => 'Einheit', 'preis' => 'Preis', - 'published' => 'Published', + 'published' => 'Öffentlich', ); } @@ -86,6 +91,7 @@ class AngebotVerein extends CActiveRecord $criteria->compare('angebot_id',$this->angebot_id); $criteria->compare('verein_id',$this->verein_id); $criteria->compare('menge',$this->menge); + $criteria->compare('einheit',$this->einheit,true); $criteria->compare('preis',$this->preis); $criteria->compare('published',$this->published); diff --git a/protected/models/Standort.php b/protected/models/Standort.php index 48493f6..b7eddcf 100644 --- a/protected/models/Standort.php +++ b/protected/models/Standort.php @@ -5,6 +5,7 @@ * * The followings are the available columns in table 'standort': * @property integer $id + * @property string $type * @property string $name * @property double $pos_lat * @property double $pos_long @@ -43,13 +44,14 @@ 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('name, pos_lat, pos_long, type', 'required'), array('published', 'numerical', 'integerOnly'=>true), array('pos_lat, pos_long', 'numerical'), + array('type', 'length', 'max'=>6), array('name', 'length', 'max'=>80), // The following rule is used by search(). // Please remove those attributes that should not be searched. - array('id, name, pos_lat, pos_long, published', 'safe', 'on'=>'search'), + array('id, type, name, pos_lat, pos_long, published', 'safe', 'on'=>'search'), ); } @@ -71,6 +73,7 @@ class Standort extends CActiveRecord { return array( 'id' => 'ID', + 'type' => 'Type', 'name' => 'Name', 'pos_lat' => 'Pos Lat', 'pos_long' => 'Pos Long', @@ -90,6 +93,7 @@ class Standort extends CActiveRecord $criteria=new CDbCriteria; $criteria->compare('id',$this->id); + $criteria->compare('type',$this->type,true); $criteria->compare('name',$this->name,true); $criteria->compare('pos_lat',$this->pos_lat); $criteria->compare('pos_long',$this->pos_long); diff --git a/protected/models/Verein.php b/protected/models/Verein.php index dba05db..d740c8a 100644 --- a/protected/models/Verein.php +++ b/protected/models/Verein.php @@ -48,8 +48,8 @@ class Verein extends CActiveRecord array('standort_id, published', 'numerical', 'integerOnly'=>true), array('name, url', 'length', 'max'=>255), array('bild, email, slug', 'length', 'max'=>100), - array("url", "url", "allowEmpty"=>true, "message"=>"Die eingebene URL ist ung�ltig."), - array("email", "email", "message"=>"Die eingebene eMail-Adresse ist ung�ltig."), + array("url", "url", "allowEmpty"=>true, "message"=>"Die eingebene URL ist ungültig."), + array("email", "email", "message"=>"Die eingebene eMail-Adresse ist ungültig."), array("uploadedImage", "file", "types"=>"jpg, gif, png", "allowEmpty"=>true, "wrongType"=>'Die Datei "{file}" konnte nicht hochgeladen werden. Es sind nur Dateien mit den folgenden Endungen erlaubt: {extensions}.'), array('kontaktdaten, beschreibung', 'safe'), // The following rule is used by search(). |
