<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "recentCauses".
 *
 * @property integer $id
 * @property string $title
 * @property string $shortContent
 * @property string $image
 */
class RecentCauses extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'recentCauses';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['title', 'shortContent', 'image'], 'required'],
            [['title'], 'string', 'max' => 100],
			[['image'], 'file', 'extensions'=>'jpg, gif, png'],
			[['image'],  'safe'],
            [['shortContent', 'image'], 'string', 'max' => 500]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'title' => 'Title',
            'shortContent' => 'Short Content',
            'image' => 'Image',
        ];
    }
}
