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("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(). // Please remove those attributes that should not be searched. array('id, name, url, bild, email, slug, kontaktdaten, beschreibung, standort_id, published', 'safe', 'on'=>'search'), ); } /** * @return array relational rules. */ public function relations() { // NOTE: you may need to adjust the relation name and the related // class name for the relations automatically generated below. return array( "standort"=>array(self::HAS_ONE, "Standort", array('id'=>'standort_id')) ); } /** * @return array customized attribute labels (name=>label) */ public function attributeLabels() { return array( 'id' => 'ID', 'name' => 'Name', 'url' => 'Homepage', 'bild' => 'Logo', 'email' => 'Email', 'slug' => 'Anmeldename', 'kontaktdaten' => 'Kontaktdaten', 'beschreibung' => 'Beschreibung', 'standort_id' => 'Standort', 'standort' => 'Standort', 'published' => 'Öffentlich', ); } /** * Retrieves a list of models based on the current search/filter conditions. * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. */ public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('id',$this->id); $criteria->compare('name',$this->name,true); $criteria->compare('url',$this->url,true); $criteria->compare('bild',$this->bild,true); $criteria->compare('email',$this->email,true); $criteria->compare('slug',$this->slug,true); $criteria->compare('kontaktdaten',$this->kontaktdaten,true); $criteria->compare('beschreibung',$this->beschreibung,true); $criteria->compare('standort_id',$this->standort_id); $criteria->compare('published',$this->published); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); } public function behaviors() { return array( 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', ); } }