本文整理汇总了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';
}
}
}
示例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!'));
}
示例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'));
}
示例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;
}
示例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;
}