Note that there are some explanatory texts on larger screens.

plurals
  1. POProperty "Alerts.alert_status_id" is not defined in Yii application
    primarykey
    data
    text
    <p>Here is my <code>Alerts</code> model:</p> <pre><code>&lt;?php /** * This is the model class for table "alerts". * * The followings are the available columns in table 'alerts': * @property string $id * @property string $alert_status_id * @property string $cmas_regions * @property string $alert_type_id * @property string $agency_id * @property string $incident_at * @property string $entered_by_given_name * @property string $entered_by_surname * @property integer $incident_location_state_reference_code * @property string $incident_location_county * @property string $incident_location_city * @property string $incident_location_latitude * @property string $incident_location_longitude * @property string $incident_location_address1 * @property string $incident_location_address2 * @property string $incident_location_postal_code * @property integer $cap_expiration_interval * @property string $audio_url * @property string $wordpress_post_id * @property string $incident_summary * @property string $ncic_case_number * @property string $local_case_number * @property string $information_provider_given_name * @property string $information_provider_surname * @property string $activation_authorization_officer_given_name * @property integer $activation_authorization_officer_surname * @property string $activation_authorization_officer_given_rank * @property string $activation_authorization_officer_badge_number * @property string $activated_at * @property string $cancellation_authorization_officer_first_name * @property string $cancellation_authorization_officer_surname * @property string $cancellation_authorization_officer_rank * @property string $cancellation_authorization_officer_badge_number * * The followings are the available model relations: * @property AlertLog[] $alertLogs * @property AlertPersons[] $alertPersons * @property AlertVehicles[] $alertVehicles * @property AlertTypes $alertType * @property AlertStatuses $alertStatus * @property StatesReference $incidentLocationStateReferenceCode * @property Agencies $agency * @property CapRegions[] $capRegions * @property DistributionLists[] $distributionLists * @property SharedAlertRequests[] $sharedAlertRequests * @property SharedAlerts[] $sharedAlerts */ class Alerts extends CActiveRecord { /** * Returns the static model of the specified AR class. * @param string $className active record class name. * @return Alerts the static model class */ public static function model($className=__CLASS__) { return parent::model($className); } /** * @return string the associated database table name */ public function tableName() { return 'alerts'; } /** * @return array validation rules for model attributes. */ public function rules() { // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( array('alert_status_id, alert_type_id, agency_id, incident_at, entered_by_given_name, entered_by_surname, incident_summary', 'required'), array('incident_location_state_reference_code, cap_expiration_interval, activation_authorization_officer_surname', 'numerical', 'integerOnly'=&gt;true), array('alert_status_id, alert_type_id, agency_id, incident_location_postal_code, wordpress_post_id, ncic_case_number', 'length', 'max'=&gt;10), array('entered_by_given_name, entered_by_surname, incident_location_county, incident_location_city, incident_location_address1, incident_location_address2, information_provider_given_name, information_provider_surname, activation_authorization_officer_given_name, activation_authorization_officer_given_rank, activation_authorization_officer_badge_number, cancellation_authorization_officer_first_name, cancellation_authorization_officer_surname, cancellation_authorization_officer_rank, cancellation_authorization_officer_badge_number', 'length', 'max'=&gt;63), array('incident_location_latitude', 'length', 'max'=&gt;11), array('incident_location_longitude, local_case_number', 'length', 'max'=&gt;12), array('cmas_regions, audio_url', 'length', 'max'=&gt;255), array('activated_at', 'safe'), // The following rule is used by search(). // Please remove those attributes that should not be searched. array('id, alert_status_id, alert_type_id, agency_id, incident_at, entered_by_given_name, entered_by_surname, incident_location_state_reference_code, incident_location_county, incident_location_city, incident_location_latitude, incident_location_longitude, incident_location_address1, incident_location_address2, incident_location_postal_code, cmas_regions, cap_expiration_interval, audio_url, wordpress_post_id, incident_summary, ncic_case_number, local_case_number, information_provider_given_name, information_provider_surname, activation_authorization_officer_given_name, activation_authorization_officer_surname, activation_authorization_officer_given_rank, activation_authorization_officer_badge_number, activated_at, cancellation_authorization_officer_first_name, cancellation_authorization_officer_surname, cancellation_authorization_officer_rank, cancellation_authorization_officer_badge_number', 'safe', 'on'=&gt;'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( 'alertLogs' =&gt; array(self::HAS_MANY, 'AlertLog', 'alert_id'), 'alertPersons' =&gt; array(self::HAS_MANY, 'AlertPersons', 'alert_id'), 'alertVehicles' =&gt; array(self::HAS_MANY, 'AlertVehicles', 'alert_id'), 'alertType' =&gt; array(self::BELONGS_TO, 'AlertTypes', 'alert_type_id'), 'alertStatus' =&gt; array(self::BELONGS_TO, 'AlertStatuses', 'alert_status_id'), 'incidentLocationStateReferenceCode' =&gt; array(self::BELONGS_TO, 'StatesReference', 'incident_location_state_reference_code'), 'agency' =&gt; array(self::BELONGS_TO, 'Agencies', 'agency_id'), 'capRegions' =&gt; array(self::MANY_MANY, 'CapRegions', 'alerts_has_cap_regions(alerts_id, cap_regions_id)'), 'distributionLists' =&gt; array(self::MANY_MANY, 'DistributionLists', 'alerts_has_distribution_lists(alert_id, distribution_list_id)'), 'sharedAlertRequests' =&gt; array(self::HAS_MANY, 'SharedAlertRequests', 'alert_id'), 'sharedAlerts' =&gt; array(self::HAS_MANY, 'SharedAlerts', 'alert_id'), ); } public function getHour() { return date('H',strtotime($this-&gt;incident_at)); } public function getMinute() { return date('i',strtotime($this-&gt;incident_at)); } public function getDate() { return date('Y-m-d',strtotime($this-&gt;incident_at)); } /** * @return array customized attribute labels (name=&gt;label) */ public function attributeLabels() { return array( 'id' =&gt; 'ID', 'alert_status_id' =&gt; 'Alert Statuses', 'cmas_regions' =&gt; 'Cmas Regions', 'alert_type_id' =&gt; 'Alert Type', 'agency_id' =&gt; 'Agency', 'incident_at' =&gt; 'Incident At', 'entered_by_given_name' =&gt; 'First Name', 'entered_by_surname' =&gt; 'Last Name', 'incident_location_state_reference_code' =&gt; 'State', 'incident_location_county' =&gt; 'County', 'incident_location_city' =&gt; 'City', 'incident_location_latitude' =&gt; 'Latitude', 'incident_location_longitude' =&gt; 'Longitude', 'incident_location_address1' =&gt; 'Address1', 'incident_location_address2' =&gt; 'Address2', 'incident_location_postal_code' =&gt; 'Postal Code', 'min'=&gt; 'Minute', 'cmas_regions' =&gt; 'Cmas Regions', 'cap_expiration_interval' =&gt; 'Cap Expiration Interval', 'audio_url' =&gt; 'Audio Url', 'wordpress_post_id' =&gt; 'Wordpress Post', 'incident_summary' =&gt; 'Incident Summary', 'ncic_case_number' =&gt; 'Ncic Case Number', 'local_case_number' =&gt; 'Local Case Number', 'information_provider_given_name' =&gt; 'First Name', 'information_provider_surname' =&gt; 'Last Name', 'activation_authorization_officer_given_name' =&gt; 'First Name', 'activation_authorization_officer_surname' =&gt; 'Last Name', 'activation_authorization_officer_given_rank' =&gt; 'Officer Rank', 'activation_authorization_officer_badge_number' =&gt; 'Officer Badge Number', 'activated_at' =&gt; 'Activated At', 'cancellation_authorization_officer_first_name' =&gt; 'First Name', 'cancellation_authorization_officer_surname' =&gt; 'Last Name', 'cancellation_authorization_officer_rank' =&gt; 'Officer Rank', 'cancellation_authorization_officer_badge_number' =&gt; 'Officer Badge Number', ); } /** * 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-&gt;compare('id',$this-&gt;id,true); $criteria-&gt;compare('alert_status_id',$this-&gt;alert_status_id,true); $criteria-&gt;compare('cmas_regions',$this-&gt;cmas_regions,true); $criteria-&gt;compare('alert_type_id',$this-&gt;alert_type_id,true); $criteria-&gt;compare('agency_id',$this-&gt;agency_id,true); $criteria-&gt;compare('incident_at',$this-&gt;incident_at,true); $criteria-&gt;compare('entered_by_given_name',$this-&gt;entered_by_given_name,true); $criteria-&gt;compare('entered_by_surname',$this-&gt;entered_by_surname,true); $criteria-&gt;compare('incident_location_state_reference_code',$this-&gt;incident_location_state_reference_code); $criteria-&gt;compare('incident_location_county',$this-&gt;incident_location_county,true); $criteria-&gt;compare('incident_location_city',$this-&gt;incident_location_city,true); $criteria-&gt;compare('incident_location_latitude',$this-&gt;incident_location_latitude,true); $criteria-&gt;compare('incident_location_longitude',$this-&gt;incident_location_longitude,true); $criteria-&gt;compare('incident_location_address1',$this-&gt;incident_location_address1,true); $criteria-&gt;compare('incident_location_address2',$this-&gt;incident_location_address2,true); $criteria-&gt;compare('incident_location_postal_code',$this-&gt;incident_location_postal_code,true); $criteria-&gt;compare('cmas_regions',$this-&gt;cmas_regions,true); $criteria-&gt;compare('cap_expiration_interval',$this-&gt;cap_expiration_interval); $criteria-&gt;compare('audio_url',$this-&gt;audio_url,true); $criteria-&gt;compare('wordpress_post_id',$this-&gt;wordpress_post_id,true); $criteria-&gt;compare('incident_summary',$this-&gt;incident_summary,true); $criteria-&gt;compare('ncic_case_number',$this-&gt;ncic_case_number,true); $criteria-&gt;compare('local_case_number',$this-&gt;local_case_number,true); $criteria-&gt;compare('information_provider_given_name',$this-&gt;information_provider_given_name,true); $criteria-&gt;compare('information_provider_surname',$this-&gt;information_provider_surname,true); $criteria-&gt;compare('activation_authorization_officer_given_name',$this-&gt;activation_authorization_officer_given_name,true); $criteria-&gt;compare('activation_authorization_officer_surname',$this-&gt;activation_authorization_officer_surname); $criteria-&gt;compare('activation_authorization_officer_given_rank',$this-&gt;activation_authorization_officer_given_rank,true); $criteria-&gt;compare('activation_authorization_officer_badge_number',$this-&gt;activation_authorization_officer_badge_number,true); $criteria-&gt;compare('activated_at',$this-&gt;activated_at,true); $criteria-&gt;compare('cancellation_authorization_officer_first_name',$this-&gt;cancellation_authorization_officer_first_name,true); $criteria-&gt;compare('cancellation_authorization_officer_surname',$this-&gt;cancellation_authorization_officer_surname,true); $criteria-&gt;compare('cancellation_authorization_officer_rank',$this-&gt;cancellation_authorization_officer_rank,true); $criteria-&gt;compare('cancellation_authorization_officer_badge_number',$this-&gt;cancellation_authorization_officer_badge_number,true); return new CActiveDataProvider($this, array( 'criteria'=&gt;$criteria, )); } } </code></pre> <p>I am calling it in controller by following line :</p> <pre><code>$alert_model = new Alerts; $this-&gt;performAjaxValidation(array( $alert_model, $agency_model, $victim_model, $suspect_model, $vehicle_model )); $status = AlertStatuses::model()-&gt;find("name='created'"); $alert_model-&gt;alert_status_id = $status-&gt;id; </code></pre> <p>This is the error message:</p> <blockquote> <p>Error: Property "Alerts.alert_status_id" is not defined. </p> </blockquote> <p>Any help is much appreciated!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload