yii ActiveRecord

In the event record in the custom attributes (data not attribute table), at first did not notice the problem in this model inherited activeRecord in, also customize a lot of ways, this is the premise of the question arises: Use property acquisition less than a database field, being given `unknown property, app \ course \ models \ Wxpay :: appid` property error does not exist, because Yii is automatically associated with each column of the table for the definition of a property in the Active Record. checked the database field names and attribute names did wrong, I thought it was caused by a custom property, so those custom attributes commented out or error. Internet access, tried it

\ Yii :: $ App -> db3-> getSchema () -> refreshTableSchema ( 'wxpay_config');   // clean up the table structure specified cache data 
\ Yii :: $ App -> db3-> getSchema () -> Refresh () ; // clear all cache data table 
// was so bad, but afterwards I deliberately went down and found that I did not configure the cache -_- #

I also rebuilt at the table, or not later saw on the Internet a custom property in the active record in the article, suddenly found my attributes method was wrong, I put this method overrides. After commented this method, successful visit to the property . I would write this method is introduced in the field should be used attributeLabels method. mistake. in the research study attributes method requires.

Guess you like

Origin www.cnblogs.com/bneglect/p/11447283.html