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


PHP SMS::model方法代码示例

本文整理汇总了PHP中SMS::model方法的典型用法代码示例。如果您正苦于以下问题:PHP SMS::model方法的具体用法?PHP SMS::model怎么用?PHP SMS::model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SMS的用法示例。


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

示例1: cascade_delete

 public function cascade_delete()
 {
     $id = $this->id;
     // delete basic info mappings
     $basic_info = BasicInfo::model()->findByAttributes(array('userid' => $id));
     if (isset($basic_info)) {
         $basic_info->delete();
     }
     // delete company info mapping
     $comp_info = CompanyInfo::model()->findByAttributes(array('FK_userid' => $id));
     if (isset($comp_info)) {
         $comp_info->delete();
     }
     // delete sms mappings
     $sms_mappings = SMS::model()->findAll("sender_id=:id OR receiver_id=:id ", array(':id' => $id));
     foreach ($sms_mappings as $sms_mapping) {
         $sms_mapping->delete();
     }
     // delete education mapping
     $edu_mappings = Education::model()->findAllByAttributes(array('FK_user_id' => $id));
     foreach ($edu_mappings as $edu_mapping) {
         $edu_mapping->delete();
     }
     // delete skills mappings
     $skills_mappings = StudentSkillMap::model()->findAllByAttributes(array('userid' => $id));
     foreach ($skills_mappings as $skills_mapping) {
         $skills_mapping->delete();
     }
     // delete application mappings
     $app_mappings = Application::model()->findAllByAttributes(array('userid' => $id));
     foreach ($app_mappings as $app_mapping) {
         $app_mapping->delete();
     }
     // delete jobs mappings
     $job_mappings = Job::model()->findAllByAttributes(array('FK_poster' => $id));
     foreach ($job_mappings as $job_mapping) {
         $job_mapping->cascade_delete();
     }
     $this->delete();
 }
开发者ID:erick305,项目名称:testing,代码行数:40,代码来源:User.php

示例2: loadModel

 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return SMS the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = SMS::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
开发者ID:erick305,项目名称:testing,代码行数:15,代码来源:SMSController.php


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