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


PHP Mapper::ljoin方法代码示例

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


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

示例1: while

     $counter = $maxtimeout;
 }
 while ($waiting && $counter < $maxtimeout) {
     // check if *ALL* data is there
     $dataMapper = new Mapper('Data');
     $dataMapper->filter('uid = (?)', $process_file['SeriesInstanceUID'][0]);
     $dataMapper->filter('nb_files = status', '');
     $dataResult = $dataMapper->get();
     if (count($dataResult['Data']) > 0) {
         echo "--> data found <--" . PHP_EOL;
         //
         // DATA HAS ARRIVED
         //
         // get patient
         $patientMapper = new Mapper('Data_Patient');
         $patientMapper->ljoin('Patient', 'Patient.id = Data_Patient.patient_id');
         $patientMapper->filter('Data_Patient.data_id = (?)', $dataResult['Data'][0]->id);
         $patientResult = $patientMapper->get();
         // create feed patient directories
         // mkdir if dir doesn't exist
         // create folder if doesnt exists
         $datadirname = $output_directory . '/' . $patientResult['Patient'][0]->uid . '-' . $patientResult['Patient'][0]->id;
         if (!is_dir($datadirname)) {
             mkdir($datadirname);
         }
         // study directory
         // get study description
         $studyMapper = new Mapper('Study');
         $studyMapper->filter('uid = (?)', $process_file['StudyInstanceUID'][0]);
         $studyResult = $studyMapper->get();
         $study_dir_name = formatStudy($studyResult['Study'][0]->date, $studyResult['Study'][0]->age, $studyResult['Study'][0]->description) . '-' . $studyResult['Study'][0]->id;
开发者ID:masroore,项目名称:chrisreloaded,代码行数:31,代码来源:process.php

示例2: getHTML

 /**
  * Get HTML representation of the given object.
  * @param Feed $object object to be converted to HMTL.
  * @return string HTML representation of the object
  */
 public static function getHTML($object, $shine = '')
 {
     // Format username
     $username = FeedV::_getUsername($object->user_id);
     $username_displayed = ucwords($username);
     $feed_meta_simple = '';
     // Format simple meta feed
     $feedMetaSimpleMapper = new Mapper('Feed');
     $feedMetaSimpleMapper->ljoin('Meta', 'meta.target_id = feed.id')->filter('meta.target_type=(?)', 'feed')->filter('meta.name=(?)', 'sharer_id')->filter('meta.target_id=(?)', $object->id)->filter('meta.type=(?)', 'simple');
     $feedMetaSimpleResults = $feedMetaSimpleMapper->get();
     $shared_feed = false;
     if (count($feedMetaSimpleResults['Meta']) >= 1) {
         $username_displayed = 'Shared by ' . ucwords(FeedV::_getUsername($feedMetaSimpleResults['Meta'][0]->value));
         $shared_feed = true;
     }
     // Format advanced meta feed
     $root_id = 0;
     $root_id = FeedV::findFirstRootID($object->id);
     $feed_meta_advanced = $feed_meta_simple;
     $feed_status = 'feed_success';
     $feed_folder = joinPaths(CHRIS_USERS, $username, $object->plugin, $object->name . '-' . $object->id);
     if ($handle = opendir($feed_folder)) {
         while (false !== ($entry = readdir($handle))) {
             if ($entry != "." && $entry != "..") {
                 $match = glob($feed_folder . '/' . $entry . '/_chrisRun_/ERR*');
                 if (count($match)) {
                     $feed_status = 'feed_failure';
                     break;
                 }
                 if ($feed_status == 'feed_failure') {
                     break;
                 }
             }
         }
     }
     // create the status text
     $status_text = '<span style="background-color: #009DE9;color: #fff;padding: 1px 2px;">Running<i class="icon-refresh rotating_class"></i></span>';
     // ('.$object->status.'%)
     if ($feed_status == 'feed_failure') {
         $status_text = '<span style="background-color: #E90000;color: #fff;padding: 1px 2px;">Errors</span>';
         $feed_status = 'feed_success';
     } else {
         if ($object->status == 100) {
             $status_text = '<span style="background-color: #41E900;color: #fff;padding: 1px 2px;">Success</span>';
         } else {
             if ($object->status == 101) {
                 $status_text = '<span style="background-color: #E95D00;color: #fff;padding: 1px 2px;">Canceled</span>';
             }
         }
     }
     $view_icon = 'icon-eye-open';
     $share_icon = 'icon-share-alt';
     $tag_icon = 'icon-tag';
     $archive_icon = 'icon-remove';
     $archive_text = 'Archive';
     if ($object->archive == '1') {
         $archive_icon = 'icon-plus';
         $archive_text = 'Restore';
     }
     $favorite_icon = 'icon-star-empty';
     $favorite_text = 'Favorite';
     if ($object->favorite == '1') {
         $favorite_icon = 'icon-star';
         $favorite_text = '<b>Favorited</b>';
     }
     $edit_icon = '';
     $cancel = '';
     $view = "display:none";
     if ($object->status >= 100 || $shared_feed) {
         $edit_icon = "<img class='feed_edit_icon show_me focus' src='view/gfx/jigsoar-icons/dark/16_edit_page2.png'>";
         // if the job is not queued or running, don't display the cancel icon
         // also if the feed was shared
         $cancel = "display:none";
         $view = "";
     }
     $t = new Template('feed.html');
     $t->replace('ID', $object->id);
     $t->replace('ROOT_ID', $root_id);
     $feed_gfx64 = 'plugins/' . $object->plugin . '/feed.png';
     $feed_gfx64_checked = 'view/gfx/feed_checked.png';
     if (!is_file(joinPaths(CHRIS_WWWROOT, $feed_gfx64))) {
         $feed_gfx64 = 'http://placehold.it/48x48';
     }
     $t->replace('IMAGE_SRC', $feed_gfx64);
     $t->replace('IMAGE_CHECKED', $feed_gfx64_checked);
     $t->replace('USERNAME', $username_displayed);
     $t->replace('FEED_STATUS', $feed_status);
     $t->replace('FEED_NAME', $object->name);
     $t->replace('FEED_META_CONTENT', $feed_meta_advanced);
     $t->replace('TIME_FORMATED', $object->time);
     $t->replace('PLUGIN', ucwords(str_replace('_', ' ', $object->plugin)));
     $t->replace('STATUS', $object->status);
     $t->replace('STATUS_TEXT', $status_text);
     $t->replace('VIEW_ICON', $view_icon);
     $t->replace('SHARE_ICON', $share_icon);
//.........这里部分代码省略.........
开发者ID:masroore,项目名称:chrisreloaded,代码行数:101,代码来源:feed.view.php

示例3: date

$logFile = $output_dir . 'search.log';
//
// 2- INSTANTIATE MAPPER CLASS
//
$instateLog = '=======================================' . PHP_EOL;
$instateLog .= date('Y-m-d h:i:s') . ' ---> Instantiate MAPPER class...' . PHP_EOL;
$fh = fopen($logFile, 'a') or die("can't open file");
fwrite($fh, $instateLog);
fclose($fh);
$processLog = '=======================================' . PHP_EOL;
$processLog .= date('Y-m-d h:i:s') . ' ---> Create SQL query...' . PHP_EOL;
// if we have matches on patient, look for matches on the data!
// get all data for patient and link it to its study
// with search conditions
$mapper = new Mapper('Patient');
$mapper->ljoin('Data_Patient', 'patient.id = Data_Patient.patient_id')->ljoin('Data', 'Data_Patient.data_id = data.id')->ljoin('Data_Study', 'data.id = Data_Study.data_id')->ljoin('Study', 'Data_Study.study_id = study.id');
if ($input != '') {
    $mapper->filter('', '', 0, 'OR');
    $mapper->filter('patient.name LIKE CONCAT("%",?,"%")', $input, 1, 'OR');
    $processLog .= 'name: ' . $input . PHP_EOL;
    $mapper->filter('patient.dob LIKE CONCAT("%",?,"%")', $input, 2, 'OR');
    $processLog .= 'dob: ' . $input . PHP_EOL;
    $mapper->filter('patient.uid LIKE CONCAT("%",?,"%")', $input, 3, 'OR');
    $processLog .= 'uid: ' . $input . PHP_EOL;
    $mapper->filter('patient.sex LIKE CONCAT("%",?,"%")', $input, 4, 'OR');
    $processLog .= 'sex: ' . $input . PHP_EOL;
    $mapper->filter('data.description LIKE CONCAT("%",?,"%")', $input, 5, 'OR');
    $processLog .= 'description: ' . $input . PHP_EOL;
    $mapper->filter('study.location LIKE CONCAT("%",?,"%")', $input, 6, 'OR');
    $processLog .= 'location: ' . $input . PHP_EOL;
    $mapper->filter('study.modality LIKE CONCAT("%",?,"%")', $input, 7, 'OR');
开发者ID:masroore,项目名称:chrisreloaded,代码行数:31,代码来源:search.php


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