34 lines
1.3 KiB
PHP
34 lines
1.3 KiB
PHP
<?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'],
|
|
];
|
|
}
|
|
}
|