Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • ActionFormModel
  • ArrayUtil
  • ArrayValidator
  • AssociatedMediaBehavior
  • AuxLib
  • Changelog
  • DetailView
  • EncryptUtilTmp
  • EventsWidgetFieldFormatter
  • FailedLogins
  • FieldFormatter
  • FieldFormatterBase
  • FieldInputRenderer
  • FileFieldBehavior
  • FiltersForm
  • FilterUtil
  • FineDiff
  • FineDiffCopyOp
  • FineDiffDeleteOp
  • FineDiffInsertOp
  • FineDiffOp
  • FineDiffOps
  • FineDiffReplaceOp
  • GlobalCSSFormModel
  • GlobalImportFormModel
  • GoogleAuthenticator
  • JSONFieldsBehavior
  • JSONResponse
  • MediaFieldFormatter
  • MediaSelector
  • MobileActiveRecordFieldFormatter
  • MobileActivityFeed
  • MobileChartDashboard
  • MobileFieldFormatter
  • MobileFieldInputRenderer
  • ModuleModelNameValidator
  • MultiChildNode
  • MultiTypeAutocomplete
  • PasswordUtil
  • ProductFeature
  • ProfileWidgetLayout
  • QueryParamGenerator
  • RecordLimitBehavior
  • RecordView
  • RecordViewWidgetLayout
  • RelationshipsGridModel
  • RelationshipsJoin
  • RepairUserDataCommand
  • RequestUtil
  • RequiredIfNotSetValidator
  • ResponseUtil
  • RunMigrationScriptCommand
  • ServiceWebFormDesigner
  • Settings
  • StringUtil
  • TestEmailAction
  • TestEmailActionForm
  • ThemeGenerator
  • TimerUtil
  • TopicsFieldFormatter
  • TopicsWidgetLayout
  • TransactionalViewFieldFormatter
  • UrlUtil
  • ValidLinkValidator
  • WebFormDesigner
  • WebLeadFormDesigner
  • X2ActiveRecordBehavior
  • X2ActiveRecordFieldFormatter
  • X2ButtonColumn
  • X2ConditionList
  • X2ConsoleCommand
  • X2ControllerBehavior
  • X2DataColumn
  • X2DuplicateBehavior
  • X2Flashes
  • X2GridViewFieldFormatter
  • X2IPAddress
  • X2LeadsDataColumn
  • X2MergeableBehavior
  • X2MessageSource
  • X2MobileControllerBehavior
  • X2MobileProfileControllerBehavior
  • X2MobileQuotesControllerBehavior
  • X2MobileSiteControllerBehavior
  • X2MobileTopicsControllerBehavior
  • X2ModelConversionBehavior
  • X2ModelConversionWidget
  • X2ModelForeignKeyValidator
  • X2ModelUniqueIndexValidator
  • X2NonWebUser
  • X2StaticDropdown
  • X2StaticField
  • X2StaticFieldsBehavior
  • X2UrlManager
  • X2Validator
  • X2WidgetBehavior

Interfaces

  • AdminOwnedCredentials

Exceptions

  • CampaignMailingException
  • CodeExchangeException
  • GetCredentialsException
  • NoRefreshTokenException
  • NoUserIdException
  • StringUtilException

Functions

  • checkCurrency
  • checkDNS
  • checkServerVar
  • checkTimezone
  • decodeQuotes
  • echoIcons
  • encodeQuotes
  • exceptionForError
  • getField
  • getLanguageName
  • getModuleTitle
  • handleReqError
  • handleReqException
  • installer_t
  • installer_tr
  • isAllowedDir
  • mediaMigrationRrmdir
  • migrateMediaDir
  • printGraph
  • printR
  • renderFields
  • reqShutdown
  • RIP
  • translateOptions
  • tryGetRemote
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: 
  3: /*
  4:  * To change this template, choose Tools | Templates
  5:  * and open the template in the editor.
  6:  */
  7: 
  8: /**
  9:  * Description of ProductFeature
 10:  *
 11:  * @author demetrius
 12:  */
 13: class ProductFeature extends X2Model {
 14: 
 15:     public $supportsWorkflow = false;
 16: 
 17:     /**
 18:      * Returns the static model of the specified AR class.
 19:      * @return Template the static model class
 20:      */
 21:     public static function model($className=__CLASS__) { return parent::model($className); }
 22: 
 23:     /**
 24:      * @return string the associated database table name
 25:      */
 26:     public function tableName() { return 'x2_product_features'; }
 27: 
 28:     public function behaviors() {
 29:         return array_merge(parent::behaviors(),array(
 30:             'X2LinkableBehavior'=>array(
 31:                 'class'=>'X2LinkableBehavior',
 32:                 'baseRoute'=>'/products/products/productFeature'
 33:             )
 34:         ));
 35:     }
 36: 
 37:     /**
 38:      * @return array validation rules for model attributes.
 39:      */
 40:     public function rules() {
 41:         // NOTE: you should only define rules for those attributes that
 42:         // will receive user inputs.
 43:         $fields=Fields::model()->findAllByAttributes(array('modelName'=>get_class($this)));
 44:                 $arr=array(
 45:                     'varchar'=>array(),
 46:                     'text'=>array(),
 47:                     'date'=>array(),
 48:                     'dropdown'=>array(),
 49:                     'int'=>array(),
 50:                     'email'=>array(),
 51:                     'currency'=>array(),
 52:                     'url'=>array(),
 53:                     'float'=>array(),
 54:                     'boolean'=>array(),
 55:                     'required'=>array(),
 56:                     
 57:                 );
 58:                 $rules=array();
 59:                 foreach($fields as $field){
 60:             $arr[$field->type][]=$field->fieldName;
 61:             if($field->required)
 62:                 $arr['required'][]=$field->fieldName;
 63:                         if($field->type!='date')
 64:                             $arr['search'][]=$field->fieldName;
 65:         }
 66:                 $arr['search'][]='name';
 67:         foreach($arr as $key=>$array){
 68:             switch($key){
 69:                 case 'email':
 70:                     $rules[]=array(implode(',',$array),$key);
 71:                     break;
 72:                 case 'required':
 73:                     $rules[]=array(implode(',',$array),$key);
 74:                     break;
 75:                                 case 'search':
 76:                                         $rules[]=array(implode(",",$array),'safe','on'=>'search');
 77:                                         break;
 78:                 case 'int':
 79:                     $rules[]=array(implode(',',$array),'numerical','integerOnly'=>true);
 80:                     break;
 81:                 case 'float':
 82:                     $rules[]=array(implode(',',$array),'type','type'=>'float');
 83:                     break;
 84:                 case 'boolean':
 85:                     $rules[]=array(implode(',',$array),$key);
 86:                     break;
 87:                 default:
 88:                     break;
 89:                 
 90:             }
 91:             
 92:         }  
 93:         return $rules;
 94:     }
 95: 
 96:     /**
 97:      * @return array relational rules.
 98:      */
 99:     public function relations() {
100:         // NOTE: you may need to adjust the relation name and the related
101:         // class name for the relations automatically generated below.
102:         return array(
103:         );
104:     }
105: 
106:     /**
107:      * @return array customized attribute labels (name=>label)
108:      */
109:     public function attributeLabels() {
110:         $fields=Fields::model()->findAllByAttributes(array('modelName'=>'ProductFeature'));
111:         $arr=array();
112:         foreach($fields as $field){
113:             $arr[$field->fieldName]=Yii::t('app',$field->attributeLabel);
114:         }
115:         
116:         return $arr;
117: 
118:     }
119: 
120:     /**
121:      * Retrieves a list of models based on the current search/filter conditions.
122:      * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
123:      */
124:     public function search() {
125:         // Warning: Please modify the following code to remove attributes that
126:         // should not be searched.
127: 
128:         $criteria=new CDbCriteria;
129: 
130:         $fields=Fields::model()->findAllByAttributes(array('modelName'=>'ProductFeature'));
131:         foreach($fields as $field){
132:             $fieldName=$field->fieldName;
133:             switch($field->type){
134:                 case 'boolean':
135:                     $criteria->compare($field->fieldName,$this->compareBoolean($this->$fieldName), true);
136:                     break;
137:                 case 'assignment':
138:                     $criteria->compare($field->fieldName,$this->compareAssignment($this->$fieldName), true);
139:                     break;
140:                 default:
141:                     $criteria->compare($field->fieldName,$this->$fieldName,true);
142:             }
143:             
144:         }
145: 
146:         return new CActiveDataProvider(get_class($this), array(
147:             'criteria'=>$criteria,
148:             'pagination'=>array(
149:                 'pageSize'=>Profile::getResultsPerPage(),
150:             ),
151:         ));
152:     }
153:         
154: 
155:     
156: }
157: 
158: ?>
159: 
X2CRM Documentation API documentation generated by ApiGen 2.8.0