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


PHP Institution::find方法代码示例

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


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

示例1: reservationName

function reservationName($reservation)
{
    if ($reservation->CreditorType == 2) {
        return Institution::find($reservation->CreditorId)->Name;
    } else {
        if ($reservation->CreditorId != 0) {
            return Client::find($reservation->CreditorId)->Name;
        } else {
            return 'No declarado';
        }
    }
}
开发者ID:patrickdamery,项目名称:Eirene,代码行数:12,代码来源:reservationsTable.blade.php

示例2: delete

 public static function delete($id)
 {
     if (self::get_user_admin() == null) {
         Redirect::to('/home');
     }
     $degrees = Degree::findByInstitution($id);
     if (!empty($degrees)) {
         Redirect::to('/institutions', array('error' => 'Institution could not be deleted, because it is linked to one or more degrees. First delete related degrees under Manage->Degrees.'));
     }
     $institution = Institution::find($id);
     $institution->delete();
     Redirect::to('/institutions', array('message' => 'Institution deleted!'));
 }
开发者ID:nopomi,项目名称:abinet,代码行数:13,代码来源:institution_controller.php

示例3: edit

 /**
  * Show the form for editing the specified institution.
  *
  * @param  int $id
  * @return Response
  */
 public function edit($id)
 {
     $institution = Institution::find($id);
     $fileids = json_decode($institution->logo);
     $files = array();
     foreach ($fileids as $fileid) {
         $upload = Upload::find($fileid);
         if (isset($upload)) {
             $newurl = URL::asset($upload->publicpath() . $upload->filename);
             $success = new stdClass();
             $success->name = $upload->filename;
             $success->size = $upload->size;
             $success->url = $newurl;
             $success->thumbnailUrl = $newurl;
             $success->deleteUrl = action('UploadController@delete', $upload->id);
             $success->deleteType = 'DELETE';
             $success->fileID = $upload->id;
             $files[] = $success;
         }
     }
     $json = json_encode(array('files' => $files));
     return View::make('institutions.edit', compact('institution', 'json'));
 }
开发者ID:EthanK28,项目名称:laravel-with-jquery-upload,代码行数:29,代码来源:InstitutionsController.php

示例4: makeDegreeObjectsFromQueryRows

 private static function makeDegreeObjectsFromQueryRows($rows)
 {
     $degrees = array();
     foreach ($rows as $row) {
         $query = DB::connection()->prepare('SELECT * FROM Degree_Institution WHERE degree_id = :id');
         $query->execute(array('id' => $row['id']));
         $degree_institutions = $query->fetchAll();
         $institutions = array();
         foreach ($degree_institutions as $degree_institution) {
             $institutions[] = Institution::find($degree_institution['institution_id']);
         }
         $degrees[] = new Degree(array('id' => $row['id'], 'name' => $row['name'], 'deadline' => $row['deadline'], 'description' => $row['description'], 'accepted' => $row['accepted'], 'acceptancerate' => $row['acceptancerate'], 'city' => $row['city'], 'extent' => $row['extent'], 'institutions' => $institutions));
     }
     return $degrees;
 }
开发者ID:nopomi,项目名称:abinet,代码行数:15,代码来源:Degree.php

示例5: createDegree

 private static function createDegree($params, $id)
 {
     $degree = new Degree(array('id' => $id, 'name' => $params['name'], 'extent' => $params['extent'], 'city' => $params['city'], 'accepted' => $params['accepted'], 'acceptancerate' => $params['acceptancerate'], 'deadline' => $params['deadline'], 'description' => $params['description'], 'institutions' => null));
     $institutions = array();
     if (isset($params['institutions'])) {
         foreach ($params['institutions'] as $institutionId) {
             $institutions[] = Institution::find($institutionId);
         }
     }
     $degree->institutions = $institutions;
     return $degree;
 }
开发者ID:nopomi,项目名称:abinet,代码行数:12,代码来源:degree_controller.php


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