Initial import of space_profiles module
This commit is contained in:
33
models/SpaceProfile.php
Normal file
33
models/SpaceProfile.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace humhub\modules\space_profiles\models;
|
||||
|
||||
use humhub\components\ActiveRecord;
|
||||
use humhub\modules\space_profiles\components\TemplateRegistry;
|
||||
|
||||
class SpaceProfile extends ActiveRecord
|
||||
{
|
||||
public static function tableName()
|
||||
{
|
||||
return 'rescue_space_profile';
|
||||
}
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['contentcontainer_id', 'rescue_name', 'address', 'city', 'state', 'zip', 'email', 'phone', 'animals_we_accept', 'description', 'mission_statement', 'template_key', 'slug'], 'required'],
|
||||
[['contentcontainer_id'], 'integer'],
|
||||
[['animals_we_accept', 'description', 'mission_statement', 'header_html', 'body_html', 'footer_html'], 'string'],
|
||||
[['template_key'], 'in', 'range' => array_keys(TemplateRegistry::options())],
|
||||
[['rescue_name', 'email', 'slug'], 'string', 'max' => 190],
|
||||
[['address', 'icon_path', 'background_image_path'], 'string', 'max' => 255],
|
||||
[['template_key'], 'string', 'max' => 64],
|
||||
[['city'], 'string', 'max' => 120],
|
||||
[['state'], 'string', 'max' => 2],
|
||||
[['zip'], 'string', 'max' => 10],
|
||||
[['phone'], 'string', 'max' => 32],
|
||||
[['contentcontainer_id'], 'unique'],
|
||||
[['slug'], 'unique'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user