当前位置: 首页>>代码示例>>PHP>>正文


PHP Model_Table类代码示例

本文整理汇总了PHP中Model_Table的典型用法代码示例。如果您正苦于以下问题:PHP Model_Table类的具体用法?PHP Model_Table怎么用?PHP Model_Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Model_Table类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 function init()
 {
     parent::init();
     $this->hasOne('Scholar', 'scholar_id')->mandatory('Scholar is must');
     $this->hasOne('Class', 'class_id')->mandatory('Class is Must');
     $this->hasOne('Session', 'session_id');
     $this->addField('roll_no')->type('int')->caption('roll number');
     $this->addField('ishostler')->type('boolean')->defaultValue(false)->caption("Is Hostler");
     $this->addField('isScholared')->type('boolean');
     $this->addField('Section');
     $this->addField('store_no');
     $this->addField('isalloted')->type('boolean')->defaultValue(false);
     $this->addField('is_result_stop')->type('boolean')->defaultValue(false);
     $this->addField('bpl')->type('boolean')->defaultValue(false);
     // $this->addField('result_stopped')->type('boolean')->defaultValue(false);
     $this->hasMany('RoomAllotement', 'student_id');
     $this->hasMany('Item_Issue', 'student_id');
     $this->hasMany('Students_Disease', 'student_id');
     $this->hasMany('Students_Movement', 'student_id');
     $this->hasMany('Students_Attendance', 'student_id');
     $this->hasMany('Students_Marks', 'student_id');
     $this->hasMany('Fees_Applicable', 'student_id');
     $this->addExpression('name')->set(function ($m, $q) {
         return $m->refSQL('scholar_id')->dsql()->del('field')->field('hname');
     })->display('hindi');
     $this->addExpression('fname')->set(function ($m, $q) {
         return $m->refSQL('scholar_id')->dsql()->del('field')->field('fname');
     })->caption('Name(English)');
     $this->addExpression("father_name")->set(function ($m, $q) {
         return $m->refSQL('scholar_id')->fieldQuery('father_name');
     })->display('hindi');
     $this->dsql()->order('fname', 'asc');
 }
开发者ID:xavocvijay,项目名称:atkschool,代码行数:33,代码来源:Student.php

示例2: init

 function init()
 {
     parent::init();
     $this->addField('name');
     $this->addField('year')->type('int');
     $this->addField('imdb')->caption('IMDB Link');
 }
开发者ID:xavocvijay,项目名称:atkschool,代码行数:7,代码来源:Movie.php

示例3: init

 function init()
 {
     parent::init();
     $this->hasOne('Hostel_Disease', 'disease_id');
     $this->addField('name')->caption('treatment');
     $this->addField('treatment_date')->type('datetime')->defaultValue(date('Y-m-d H:i:s'));
 }
开发者ID:xavocvijay,项目名称:atkschool,代码行数:7,代码来源:Treatment.php

示例4: init

 function init()
 {
     parent::init();
     $this->hasOne('Class', 'class_id');
     $this->hasOne('Subject', 'subject_id');
     $this->hasOne('Session', 'session_id');
 }
开发者ID:xavocvijay,项目名称:atkschool,代码行数:7,代码来源:SubjectClassMapAll.php

示例5: init

 function init()
 {
     parent::init();
     $this->addField('title');
     $this->addField('date')->type('date')->defaultValue(date('Ymd'));
     $this->addField('body')->type('text');
 }
开发者ID:xavocvijay,项目名称:atkschool,代码行数:7,代码来源:BlogPost.php

示例6: init

 function init()
 {
     parent::init();
     $this->addField('name')->display('hindi');
     $this->hasMany("ExamClassMap", "exam_id");
     $this->addHook('beforeDelete', $this);
 }
开发者ID:xavocvijay,项目名称:atkschool,代码行数:7,代码来源:Exam.php

示例7: init

 function init()
 {
     parent::init();
     $this->addField('ftype')->mandatory('Fee Head Should have a name')->caption('Fee Type');
     $this->addField('amount')->type("int")->mandatory("Fee Amount should be entered");
     $this->addField('isoptional')->type('boolean')->caption('IsOptional');
 }
开发者ID:romaninsh,项目名称:atkSchool,代码行数:7,代码来源:Fee.php

示例8: init

 function init()
 {
     parent::init();
     $this->addExpression('sn')->set($this->_dsql()->expr('(select @sn :=@sn + 1 AS sn FROM (SELECT @sn := 0) as sn)'));
     $this->addField('admission_date')->type('date')->mandatory("Required Field")->defaultValue(date('d-m-Y'));
     $this->addField('scholar_no')->mandatory("Scholar Number is Must");
     $this->addField('fname')->mandatory("Name is Must")->caption('Name(English)');
     $this->addField('hname')->mandatory("Name is Must")->caption('Name(Hindi)');
     $this->addField('father_name')->mandatory("Required Field")->caption('Father`s Name');
     //$this->add("filestore/Field_Image","f_image")->caption('father Image');
     $this->addField('mother_name')->mandatory("Required Field")->caption('Mother`s Name');
     //$this->add("filestore/Field_Image","m_image")->caption('Mother Image');
     $this->addField('guardian_name');
     $this->addField('dob')->type('date')->mandatory("Required Field")->caption('Date of Birth');
     $this->addField('contact')->mandatory("Required Field");
     $this->add("filestore/Field_Image", "student_image");
     //->type('image');//$this->add("filestore/Field_Image", "student_image");
     $this->addField('p_address')->datatype('Text')->mandatory("Required Field")->caption('Permanent Address');
     $this->addField('sex')->setValueList(array('M' => 'Male', 'F' => 'Female'));
     $this->addField("isActive")->type('boolean')->mandatory("Is This Active")->defaultValue(true);
     $this->addField('leaving_date')->type('date')->defaultValue(null);
     $this->addExpression('name')->set('hname');
     $this->addExpression('Student_name')->set('fname');
     $this->addField('category')->setValueList(array(null => 'Select Category', 'GEN' => 'GEN', "ST" => "ST", "SC" => "SC", "TAD" => "TAD(ST)", "OBC" => "OBC", "SOBC" => "SPECIAL OBC", "MINORITY" => "MINORITY"));
     //$this->addExpression('age')->set('year(now())-year(dob)');
     $this->dsql()->order('hname');
     //       if(!$all) $this->addCondition('isActive',true);
 }
开发者ID:xavocvijay,项目名称:atkschool,代码行数:28,代码来源:Scholar.php

示例9: init

 function init()
 {
     parent::init();
     $this->addField('doj')->type('date')->mandatory("Required Field")->defaultValue(date('d-m-Y'))->caption('Date of Joining');
     $this->addField('ename')->mandatory("Name is Must")->caption('Name(English)');
     $this->addField('hname')->mandatory("Name is Must")->caption('Name(Hindi)')->display('hindi');
     $this->addField('designation')->mandatory("Designation is Must")->caption('Designation')->display('hindi');
     $this->addField('father_name')->mandatory("Required Field")->caption('Father`s Name/Husband`s Name')->display('hindi');
     $this->addField('mother_name')->mandatory("Required Field")->caption('Mother`s Name')->display('hindi');
     $this->addField('guardian_name')->caption('Eligiblity')->display('hindi');
     $this->addField('dob')->type('date')->mandatory("Required Field")->caption('Date of Birth');
     $this->addField('contact')->mandatory("Required Field");
     $this->addField('pan_no')->mandatory("Required Field");
     $this->add("filestore/Field_Image", "image");
     //->type('image');//$this->add("filestore/Field_Image", "student_image");
     $this->addField('address')->type('Text')->mandatory("Required Field")->caption('Address')->display('hindi');
     $this->addField('sex')->setValueList(array('Male', 'Female'))->defaultValue('M')->display(array('form' => 'dropdown'));
     $this->addField('accno')->caption('Bank Account Number');
     $this->addField('insurance_no')->caption('Insurance');
     $this->addField('ofhostel')->type('boolean')->caption("Hostel");
     $this->addField('remarks')->type('Text')->display('hindi');
     $this->addField('is_active')->type('boolean')->defaultValue(true);
     $this->hasMany('Staff_Movement', 'staff_id');
     $this->addExpression('name')->set('hname');
     $this->_dsql()->order('ename', 'asc');
     $this->addExpression('attendance_status')->set(function ($m, $q) {
         return "(select `action` from `staff_outward` where `staff_outward`.`staff_id` = `staff_master`.`id` and `staff_outward`.`session_id` = " . $m->add('Model_Sessions_Current')->tryLoadAny()->get('id') . " order by `id` desc, `id` desc limit 0, 1) ";
         return $m->refSQL('Staff_Movement')->addCondition('session_id', $m->add('Model_Sessions_Current')->tryLoadAny()->get('id'))->_dsql()->limit(1)->order('id', 'desc')->del('field')->field('action');
     })->display('attendance');
     $fs = $this->leftJoin('filestore_file', 'image')->leftJoin('filestore_image.original_file_id')->leftJoin('filestore_file', 'thumb_file_id');
     $fs->addField('image_url', 'filename')->display(array('grid' => 'picture'));
 }
开发者ID:xavocvijay,项目名称:atkschool,代码行数:32,代码来源:All.php

示例10: init

 function init()
 {
     parent::init();
     $this->addField('employee_id')->caption('Paid To')->refModel('Model_Employee');
     $this->addField('pay_date')->datatype('date')->defaultValue(date('Y-m-d'));
     $this->addField('amount')->datatype('money');
 }
开发者ID:vikash124,项目名称:atk4-web,代码行数:7,代码来源:Salary.php

示例11: init

 function init()
 {
     parent::init();
     $this->hasOne('xepan\\cms\\Custom_Form', 'custom_form_id');
     $this->addField('value')->type('text');
     $this->addHook('afterInsert', $this);
 }
开发者ID:xepan,项目名称:cms,代码行数:7,代码来源:FormSubmission.php

示例12: init

 function init()
 {
     parent::init();
     $this->hasOne('Epan', 'epan_id')->mandatory(true);
     //$this->addCondition('epan_id',$this->api->current_website->id);
     $f = $this->addField('name')->group('a~6~<i class="fa fa-user"></i> User Info')->mandatory(true);
     $f->icon = 'fa fa-user~red';
     $f = $this->addField('type')->setValueList(array(100 => 'SuperUser', 80 => 'BackEndUser', 50 => 'FrontEndUser'))->defaultValue(0)->group('a~6');
     $f->icon = "fa fa-question~red";
     $f = $this->addField('username')->group('b~6~<i class="fa fa-lock"></i> Login Credentials')->mandatory(true);
     $f->icon = "fa fa-lock~red";
     $f = $this->addField('password')->type('password')->group('b~6')->mandatory(true);
     $f->icon = "fa fa-key~red";
     $f = $this->addField('email')->mandatory(true);
     $f->icon = "fa fa-envelope~red";
     $f = $this->addField('created_at')->type('date')->defaultValue(date('Y-m-d'))->display(array('form' => 'Readonly'))->group('c~6');
     $f->icon = 'fa fa-calendar~blue';
     // $this->addField('is_systemuser')->type('boolean')->defaultValue(false);
     // $this->addField('is_frontenduser')->type('boolean')->defaultValue(false);
     // $this->addField('is_backenduser')->type('boolean')->defaultValue(false);
     $f = $this->addField('is_active')->type('boolean')->defaultValue(false)->group('c~6');
     $f->icon = "fa fa-exclamation~blue";
     $f = $this->addField('activation_code')->group('d~3')->display(array('form' => 'Readonly'));
     $f->icon = 'fa fa-unlock-alt~blue';
     $f = $this->addField('last_login_date')->type('date')->group('d~9')->display(array('form' => 'Readonly'));
     $f->icon = 'fa fa-calendar~blue';
     $this->addHook('beforeDelete', $this);
     $this->addHook('beforeSave', $this);
     // $this->add('dynamic_model/Controller_AutoCreator');
 }
开发者ID:xepan,项目名称:xepan,代码行数:30,代码来源:Users.php

示例13: init

 function init()
 {
     parent::init();
     $this->hasOne('Category', 'parent_id')->display(array('form' => 'misc/drilldown'));
     $this->hasMany('Category', 'parent_id');
     $this->addField('name');
 }
开发者ID:atk4,项目名称:atk4-tests,代码行数:7,代码来源:drilldown.php

示例14: init

 /**
  * This class describes models which can be added on the page
  */
 function init()
 {
     parent::init();
     $this->addField('page')->caption('Appears on page');
     $this->addField('is_approved')->type('boolean')->defaultValue('Y');
     $this->addField('atk_user_id')->refModel('Model_ATK_User');
 }
开发者ID:vikash124,项目名称:atk4-web,代码行数:10,代码来源:PageContent.php

示例15: init

 function init()
 {
     parent::init();
     $this->hasOne('Epan', 'epan_id');
     $this->hasOne('MarketPlace', 'component_id');
     $this->addField('params')->system(true);
     $this->addField('enabled')->type('boolean')->defaultValue(true);
     $this->addField('installed_on')->type('date')->defaultValue(date('Y-m-d H:i:s'))->system(true);
     $marketplace_j = $this->leftJoin('epan_components_marketplace', 'component_id');
     $marketplace_j->addField('namespace');
     $marketplace_j->addField('type');
     $marketplace_j->addField('name');
     // $marketplace_j->addField('is_final');
     $marketplace_j->addField('allowed_children');
     $marketplace_j->addField('specific_to');
     $marketplace_j->addField('is_system');
     $marketplace_j->addField('description');
     // $marketplace_j->addField('plugin_hooked');
     $marketplace_j->addField('default_enabled');
     $marketplace_j->addField('has_toolbar_tools');
     $marketplace_j->addField('has_owner_modules');
     $marketplace_j->addField('has_plugins');
     $marketplace_j->addField('has_live_edit_app_page');
     // $this->add('dynamic_model/Controller_AutoCreator');
 }
开发者ID:xepan,项目名称:xepan,代码行数:25,代码来源:InstalledComponents.php


注:本文中的Model_Table类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。