3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * This is the model class for table "fileinn". * * The followings are the available columns in table 'fileinn': * @property integer $id * @property string $fileinn * * The followings are the available model relations: * @property Org[] $orgs */ class FileInn extends NTYActiveRecord { /** * Returns the static model of the specified AR class. * @param string $className active record class name. * @return FileInn 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 'file_inn'; } /** * @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('fileinn', 'required'), array('fileinn', 'file', 'allowEmpty' => false, 'safe' => true, 'types' => Yii::App()->params->TypesUpload, 'maxSize' => Yii::App()->params->SizeUpload), //array('fileinn', 'file', 'mimeTypes' => Yii::App()->params->mimeTypesUpload, 'maxSize' => 1048576), // The following rule is used by search(). // Please remove those attributes that should not be searched. array('id, fileinn', 'safe', 'on' => '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( 'orgs' => array(self::HAS_MANY, 'Org', 'id_file_inn'), ); } /** * @return array customized attribute labels (name=>label) */ public function attributeLabels() { return array( 'id' => 'ID', 'fileinn' => 'Скан-копия ИНН', ); } /** * 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->compare('id', $this->id); $criteria->compare('fileinn', $this->fileinn, true); return new CActiveDataProvider($this, array( 'criteria' => $criteria, )); } public function beforeSave() { if ($file = CUploadedFile::getInstance($this, 'fileinn')) { //$this->file_name = $file->name; //$this->file_type = $file->type; //$this->file_size = $file->size; $this->fileinn = file_get_contents($file->tempName); } return parent::beforeSave(); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zhlg4
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'fileinn', 'ntyactiverecord'
   97     1      > RETURN                                                   1

Class FileInn:
Function model:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zhlg4
function name:  model
number of ops:  6
compiled vars:  !0 = $className
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV_INIT                                        !0      'FileInn'
   21     1        INIT_STATIC_METHOD_CALL                                  'model'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
   22     5*     > RETURN                                                   null

End of function model

Function tablename:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zhlg4
function name:  tableName
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E > > RETURN                                                   'file_inn'
   29     1*     > RETURN                                                   null

End of function tablename

Function rules:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zhlg4
function name:  rules
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   INIT_ARRAY                                       ~0      <array>
   39     1        INIT_ARRAY                                       ~1      'fileinn'
          2        ADD_ARRAY_ELEMENT                                ~1      'file'
   38     3        ADD_ARRAY_ELEMENT                                ~1      <false>, 'allowEmpty'
          4        ADD_ARRAY_ELEMENT                                ~1      <true>, 'safe'
   39     5        INIT_STATIC_METHOD_CALL                                  'Yii', 'App'
          6        DO_FCALL                                      0  $2      
          7        FETCH_OBJ_R                                      ~3      $2, 'params'
          8        FETCH_OBJ_R                                      ~4      ~3, 'TypesUpload'
          9        ADD_ARRAY_ELEMENT                                ~1      ~4, 'types'
         10        INIT_STATIC_METHOD_CALL                                  'Yii', 'App'
         11        DO_FCALL                                      0  $5      
         12        FETCH_OBJ_R                                      ~6      $5, 'params'
         13        FETCH_OBJ_R                                      ~7      ~6, 'SizeUpload'
         14        ADD_ARRAY_ELEMENT                                ~1      ~7, 'maxSize'
         15        ADD_ARRAY_ELEMENT                                ~0      ~1
   38    16        ADD_ARRAY_ELEMENT                                ~0      <array>
         17      > RETURN                                                   ~0
   45    18*     > RETURN                                                   null

End of function rules

Function relations:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zhlg4
function name:  relations
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   54     0  E >   FETCH_CLASS_CONSTANT                             ~0      'HAS_MANY'
          1        INIT_ARRAY                                       ~1      ~0
          2        ADD_ARRAY_ELEMENT                                ~1      'Org'
          3        ADD_ARRAY_ELEMENT                                ~1      'id_file_inn'
          4        INIT_ARRAY                                       ~2      ~1, 'orgs'
          5      > RETURN                                                   ~2
   56     6*     > RETURN                                                   null

End of function relations

Function attributelabels:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zhlg4
function name:  attributeLabels
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   63     0  E > > RETURN                                                   <array>
   66     1*     > RETURN                                                   null

End of function attributelabels

Function search:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zhlg4
function name:  search
number of ops:  24
compiled vars:  !0 = $criteria
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   76     0  E >   NEW                                              $1      'CDbCriteria'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   78     3        INIT_METHOD_CALL                                         !0, 'compare'
          4        SEND_VAL_EX                                              'id'
          5        CHECK_FUNC_ARG                                           
          6        FETCH_OBJ_FUNC_ARG                               $4      'id'
          7        SEND_FUNC_ARG                                            $4
          8        DO_FCALL                                      0          
   79     9        INIT_METHOD_CALL                                         !0, 'compare'
         10        SEND_VAL_EX                                              'fileinn'
         11        CHECK_FUNC_ARG                                           
         12        FETCH_OBJ_FUNC_ARG                               $6      'fileinn'
         13        SEND_FUNC_ARG                                            $6
         14        SEND_VAL_EX                                              <true>
         15        DO_FCALL                                      0          
   81    16        NEW                                              $8      'CActiveDataProvider'
         17        FETCH_THIS                                       $9      
         18        SEND_VAR_EX                                              $9
   82    19        INIT_ARRAY                                       ~10     !0, 'criteria'
         20        SEND_VAL_EX                                              ~10
         21        DO_FCALL                                      0          
         22      > RETURN                                                   $8
   84    23*     > RETURN                                                   null

End of function search

Function beforesave:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/Zhlg4
function name:  beforeSave
number of ops:  17
compiled vars:  !0 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   87     0  E >   INIT_STATIC_METHOD_CALL                                  'CUploadedFile', 'getInstance'
          1        FETCH_THIS                                       $1      
          2        SEND_VAR_EX                                              $1
          3        SEND_VAL_EX                                              'fileinn'
          4        DO_FCALL                                      0  $2      
          5        ASSIGN                                           ~3      !0, $2
          6      > JMPZ                                                     ~3, ->13
   91     7    >   INIT_FCALL                                               'file_get_contents'
          8        FETCH_OBJ_R                                      ~5      !0, 'tempName'
          9        SEND_VAL                                                 ~5
         10        DO_ICALL                                         $6      
         11        ASSIGN_OBJ                                               'fileinn'
         12        OP_DATA                                                  $6
   94    13    >   INIT_STATIC_METHOD_CALL                                  'beforeSave'
         14        DO_FCALL                                      0  $7      
         15      > RETURN                                                   $7
   95    16*     > RETURN                                                   null

End of function beforesave

End of class FileInn.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.23 ms | 1404 KiB | 15 Q