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


PHP ClassRegistry::Init方法代码示例

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


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

示例1: index

 public function index()
 {
     $accreditation_types = ClassRegistry::Init('Eventure.AccreditationType')->find('all');
     $events = ClassRegistry::Init('Eventure.Event')->find('all');
     $data = $this->paginate();
     foreach ($data as $k => $v) {
         $data[$k]['Attendee'] = get_as_obj(ClassRegistry::init('Eventure.Attendee')->findById($v['Checkin']['attendee_id']), 'Attendee');
         $acc = get_as_obj(ClassRegistry::init('Eventure.Accreditation')->findById($v['Checkin']['accreditation_id']), 'Accreditation');
         $data[$k]['Accreditation'] = $acc;
     }
     //
     $this->set(compact('data', 'events', 'accreditation_types', 'attendees'));
 }
开发者ID:besimhu,项目名称:legacy,代码行数:13,代码来源:CheckinsController.php

示例2: view

 public function view($id = null)
 {
     // Find all accreditations for this event
     $acc = ClassRegistry::Init('Eventure.Accreditation')->findAllByEventId($id);
     $m = ClassRegistry::init('Eventure.Accreditation');
     foreach ($acc as &$a) {
         $a['Attendees'] = ClassRegistry::Init('Eventure.AttendeesAccreditation')->findAllByAccreditationId($a['Accreditation']['id']);
     }
     $total_attendees = $total_checkins = 0;
     foreach ($acc as $x) {
         $total_attendees += sizeof($x['Attendees']);
         $total_checkins += sizeof($x['Checkin']);
     }
     $event = $this->Event->read(null, $id);
     $all_accreditations = $m->find('all');
     $this->set(compact('event', 'acc', 'total_attendees', 'total_checkins', 'all_accreditations'));
 }
开发者ID:besimhu,项目名称:legacy,代码行数:17,代码来源:EventsController.php

示例3: __call

 /**
  * __call method
  *
  * @param mixed $method Method Called.
  * @param mixed $params Passed Parameters.
  * 
  * @return boolean
  */
 function __call($method, $params)
 {
     if (!empty($params[0]) && ($model = ClassRegistry::Init($params[0]))) {
         if (is_callable(array($model, $method))) {
             unset($params[0]);
             return call_user_func_array(array($model, $method), $params);
         }
     }
     return false;
 }
开发者ID:malamalca,项目名称:lil,代码行数:18,代码来源:LilHelper.php

示例4: ShareYahoo

 function ShareYahoo($text, $userID, $linktext, $linkurl)
 {
     App::import('Vendor', 'Yahoo', array('file' => 'yahoo/Yahoo.inc'));
     $Setting = ClassRegistry::Init("Setting");
     $settings = $Setting->find('first');
     $settings = $settings['Setting'];
     $hasSession = YahooSession::hasSession($settings['yahoo_consumer_key'], $settings['yahoo_consumer_secret'], $settings['yahoo_app_id']);
     if ($hasSession != FALSE) {
         $session = YahooSession::requireSession($settings['yahoo_consumer_key'], $settings['yahoo_consumer_secret'], $settings['yahoo_app_id']);
         $user = $session->getSessionedUser();
         // create an unique hash of the update data using md5
         $suid = md5($text . $linktext . $linkurl . time());
         // insert the update...
         $user->insertUpdate($suid, $text, $linkurl, $linktext);
         return true;
     }
     return false;
 }
开发者ID:koprals,项目名称:coda-gosales-hsbc,代码行数:18,代码来源:ActionComponent.php

示例5: ResizeImageContentCloud

 function ResizeImageContentCloud($source, $destination_path, $model_id, $model_name, $type = "original", $mime_type, $width, $height, $resizeType = 'cropResize')
 {
     $ext = pathinfo($source, PATHINFO_EXTENSION);
     $Content = ClassRegistry::Init("Content");
     $data = $Content->find("first", array("conditions" => array("Content.model_id" => $model_id, "Content.model" => $model_name, "LOWER(Content.type)" => strtolower($type))));
     if (!empty($data)) {
         $Contents["Content"]["id"] = $data["Content"]["id"];
     }
     $Contents["Content"]["model"] = $model_name;
     $Contents["Content"]["model_id"] = $model_id;
     $Contents["Content"]["host"] = $this->awsHost;
     $Contents["Content"]["mime_type"] = $mime_type;
     $Contents["Content"]["cloud"] = "1";
     App::import('Vendor', 'upload', array('file' => 'class.upload.php'));
     $img = new upload($source);
     $img->file_new_name_body = $model_id . "_" . $type;
     if ($resizeType == 'cropResize') {
         $img->image_resize = true;
         $img->image_ratio_crop = true;
         $img->image_y = $height;
         $img->image_x = $width;
     } else {
         if ($resizeType == 'resizeMaxWidth') {
             $img->image_resize = true;
             $img->image_ratio_y = true;
             $img->image_x = $width;
         }
     }
     $img->process($destination_path);
     $Contents["Content"]["type"] = $type;
     $Contents["Content"]["url"] = "contents/{$model_name}/{$model_id}/{$model_id}_{$type}.{$ext}";
     $Contents["Content"]["path"] = "contents/{$model_name}/{$model_id}/{$model_id}_{$type}.{$ext}";
     if ($img->processed) {
         $file_source = $destination_path . $model_id . "_" . $type . "." . $ext;
         if ($this->UploadToCloud($file_source, $model_id, $model_name, $type, $mime_type, $ext)) {
             unlink($file_source);
             $Content->create();
             $Content->save($Contents);
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:koprals,项目名称:coda-gosales-hsbc,代码行数:46,代码来源:GeneralComponent.php


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