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


PHP Web::find方法代码示例

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


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

示例1: ItemModelId

 function ItemModelId($path)
 {
     /* find pol, sol and the type of item */
     list($pol_id, $sol_id, $rest) = sscanf($path, "/opt/xplico/pol_%d/sol_%d/%s");
     $type = strtok($rest, '/');
     /* set sol id and pol id to avoid error permision in the controller */
     $this->Session->write('pol', $pol_id);
     $this->Session->write('sol', $sol_id);
     /* controller and id */
     $control = null;
     $id = null;
     switch ($type) {
         case 'http':
             /* load model */
             $Feed = new Feed_xml();
             /* find id */
             $control = 'Feed_xml';
             $conditions = array('Feed_xml.rs_body' => $path);
             $param = array('recursive' => 0, 'fields' => array('Feed_xml.id'), 'conditions' => $conditions);
             $id = $Feed->find('first', $param);
             if ($id == null) {
                 /* load model */
                 $Web = new Web();
                 /* find id */
                 $control = 'Web';
                 $conditions = array("or" => array('Web.rq_header' => $path, 'Web.rs_header' => $path, 'Web.rq_body' => $path, 'Web.rs_body' => $path));
                 $param = array('recursive' => 0, 'fields' => array('Web.id'), 'conditions' => $conditions);
                 $id = $Web->find('first', $param);
             }
             break;
         case 'fbwchat':
             /* load model */
             $Fbc = new Fbchat();
             /* find id */
             $control = 'Fbchat';
             $conditions = array('Fbchat.chat' => $path);
             $param = array('recursive' => 0, 'fields' => array('Fbchat.id'), 'conditions' => $conditions);
             $id = $Fbc->find('first', $param);
             break;
         case 'ftp':
             /* load model */
             $Ftp = new Ftp_file();
             /* find id */
             $control = 'Ftp_file';
             $conditions = array('Ftp_file.file_path' => $path);
             $param = array('recursive' => 0, 'fields' => array('Ftp_file.id'), 'conditions' => $conditions);
             $id = $Ftp->find('first', $param);
             if ($id == null) {
                 /* load model */
                 $Ftp = new Ftp();
                 /* find id */
                 $control = 'Ftp';
                 $conditions = array('Ftp.cmd_path' => $path);
                 $param = array('recursive' => 0, 'fields' => array('Ftp.id'), 'conditions' => $conditions);
                 $id = $Ftp->find('first', $param);
             }
             break;
         case 'ipp':
         case 'pjl':
             /* load model */
             $Pjl = new Pjl();
             /* find id */
             $control = 'Pjl';
             $conditions = array("or" => array('Pjl.pcl_path' => $path, 'Pjl.pdf_path' => $path));
             $param = array('recursive' => 0, 'fields' => array('Pjl.id'), 'conditions' => $conditions);
             $id = $Pjl->find('first', $param);
             break;
         case 'mail':
             /* load model */
             $Mail = new Email();
             /* find id */
             $control = 'Email';
             $conditions = array('Email.mime_path' => $path);
             $param = array('recursive' => 0, 'fields' => array('Email.id'), 'conditions' => $conditions);
             $id = $Mail->find('first', $param);
             break;
         case 'mms':
             /* load model */
             $Mms = new Mmscontent();
             /* find id */
             $control = 'Mmscontent';
             $conditions = array('Mmscontent.file_path' => $path);
             $param = array('recursive' => 0, 'fields' => array('Mmscontent.id'), 'conditions' => $conditions);
             $id = $Mms->find('first', $param);
             break;
         case 'nntp':
             /* load model */
             $Nntp = new Nntp_article();
             /* find id */
             $control = 'Nntp_article';
             $conditions = array('Nntp_article.mime_path' => $path);
             $param = array('recursive' => 0, 'fields' => array('Nntp_article.id'), 'conditions' => $conditions);
             $id = $Nntp->find('first', $param);
             break;
         case 'telnet':
             /* load model */
             $Teln = new Telnet();
             /* find id */
             $control = 'Telnet';
             $conditions = array('Telnet.cmd' => $path);
//.........这里部分代码省略.........
开发者ID:xplico,项目名称:xplico,代码行数:101,代码来源:search_path.php


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