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


PHP Model_Location::find方法代码示例

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


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

示例1: view

 /**
  * view method
  *
  * @access public
  * @return void
  * @author ida
  */
 public function view()
 {
     $this->fleamarket_id = \Input::param('fleamarket_id');
     $this->prefectures = \Config::get('master.prefectures');
     $this->entry_styles = \Config::get('master.entry_styles');
     $this->event_statuses = \Model_Fleamarket::getEventStatuses();
     $this->locations = \Model_Location::find('all');
     $this->link_from_list = $this->getLinkFromList();
 }
开发者ID:eva-tuantran,项目名称:use-knife-solo-instead-chef-solo-day13,代码行数:16,代码来源:index.php

示例2: action_delete

 public function action_delete($id = null)
 {
     if ($location = Model_Location::find($id)) {
         $location->delete();
         Session::set_flash('success', e('Deleted location #' . $id));
     } else {
         Session::set_flash('error', e('Could not delete location #' . $id));
     }
     Response::redirect('admin/locations');
 }
开发者ID:AfterCursor,项目名称:restaurant-pos-backend,代码行数:10,代码来源:locations.php

示例3: update_location

 private function update_location($sub, $ip)
 {
     $rack = $ip->network->device->racks;
     $room = $rack->rooms;
     $floor = $room->floors;
     $building = $floor->buildings;
     $loc = Model_Location::find()->where('rack', $rack['id'])->where('node', $sub->id)->get_one();
     if (!$loc) {
         $in = array('node' => $sub->id, 'type' => 0, 'building' => $building['id'], 'floor' => $floor['id'], 'room' => $room['id'], 'rack' => $rack['id'], 'pos_from' => 1, 'pos_to' => $rack['size']);
         $location = new Model_Location($in);
         $location->save();
     }
 }
开发者ID:quickpacket,项目名称:noclayer,代码行数:13,代码来源:test.php

示例4: checkForInhert

 private function checkForInhert($data)
 {
     //check if data already exist
     $vars = array('building', 'floor', 'room', 'rack', 'pos_from', 'pos_to');
     $b = $data[0];
     $f = $data[1];
     $ro = $data[2];
     $ra = $data[3];
     for ($i = 0; $i < 4; $i++) {
         if ($data[$i] == 'all') {
             $v = $i - 1;
             $loc = Model_Location::find()->where('node', $this->name)->where($vars[$v], $data[$v])->get_one();
             if ($loc['id'] != '') {
                 return array('v' => $v, 'i' => $i, 'base' => $vars[$v], 'val' => $data[$i], 'stat' => false, 'data' => $data);
             }
         }
     }
     $locs = Model_Location::find()->where('node', $this->name)->get();
     $taken = array();
     foreach ($locs as $loc) {
         for ($i = 0; $i < 4; $i++) {
             if ($loc[$vars[$i]] == 0) {
                 $p = $i - 1;
                 $inbase = $loc[$vars[$p]];
                 $insert = $data[$p];
                 if ($inbase == $insert) {
                     return array('base' => $inbase, 'stat' => false, 'data' => $data);
                 }
             }
         }
         if ($loc['rack'] == $data[3]) {
             if ($loc['pos_from'] <= $data[5] && $loc['pos_from'] >= $data[4]) {
                 return array('base' => 'pos_from', 'stat' => false, 'data' => $data);
             }
             if ($loc['pos_to'] <= $data[5] && $loc['pos_to'] >= $data[4]) {
                 return array('base' => 'pos_to', 'stat' => false, 'data' => $data);
             }
             if ($loc['pos_to'] <= $data[5] && $loc['pos_from'] >= $data[4]) {
                 return array('base' => 'pos_iner', 'stat' => false, 'data' => $data);
             }
             if ($loc['pos_to'] >= $data[5] && $loc['pos_from'] <= $data[4]) {
                 return array('base' => 'pos_iner', 'stat' => false, 'data' => $data);
             }
         }
     }
     return array('stat' => true, 'data' => $data);
 }
开发者ID:quickpacket,项目名称:noclayer,代码行数:47,代码来源:add.php

示例5: Floor

 public static function Floor($model, $method)
 {
     if ($method == 'before_delete') {
         $locations = Model_Location::find()->where('floor', $model->id)->get();
         foreach ($locations as $loc) {
             $loc->delete();
         }
     }
 }
开发者ID:quickpacket,项目名称:noclayer,代码行数:9,代码来源:observer.php

示例6: registerLocation

 /**
  * 会場情報を登録する
  *
  * @access private
  * @param
  * @return object
  * @author kobayashi
  */
 private function registerLocation()
 {
     $data = $this->getLocationData();
     if (!$data) {
         throw new \Exception(\Model_Error::ER00402);
     }
     if (\Input::param('location_id')) {
         $location = \Model_Location::find(\Input::post('location_id'));
         $data['updated_user'] = $this->administrator->administrator_id;
         unset($data['register_type']);
         unset($data['created_at']);
         unset($data['created_user']);
     } else {
         $location = \Model_Location::forge();
         $data['created_user'] = $this->administrator->administrator_id;
         $data['register_type'] = \Model_Location::REGISTER_TYPE_ADMIN;
     }
     if ($location) {
         $location->set($data)->save();
     }
     return $location;
 }
开发者ID:eva-tuantran,项目名称:use-knife-solo-instead-chef-solo-day13,代码行数:30,代码来源:location.php

示例7: getLocation

 /**
  * 会場情報を取得する
  *
  * @access private
  * @param mixed $location_id 会場ID
  * @return object
  * @author ida
  */
 private function getLocation($location_id)
 {
     $result = \Model_Location::find($location_id);
     return $result;
 }
开发者ID:eva-tuantran,项目名称:use-knife-solo-instead-chef-solo-day13,代码行数:13,代码来源:index.php

示例8: view

 /**
  * view method
  *
  * @access public
  * @return void
  * @author ida
  */
 public function view()
 {
     $this->entry_styles = \Config::get('master.entry_styles');
     $this->event_statuses = \Model_Fleamarket::getEventStatuses();
     $this->locations = \Model_Location::find('all');
 }
开发者ID:eva-tuantran,项目名称:use-knife-solo-instead-chef-solo-day13,代码行数:13,代码来源:confirm.php

示例9: saveLocation

 /**
  * 会場情報登録・更新
  *
  * @access private
  * @param object $fieldset フィールドセット
  * @param mixed $location_id 会場ID
  * @return bool
  * @author ida
  */
 private function saveLocation($fieldset)
 {
     $location_data = $this->createLocation($fieldset);
     if (!empty($location_data['location_id'])) {
         $location = \Model_Location::find($location_data['location_id']);
     } else {
         $location = \Model_Location::forge();
     }
     unset($location_data['location_id']);
     if ($location->set($location_data)->save()) {
         return $location;
     } else {
         throw new Exception();
     }
 }
开发者ID:eva-tuantran,项目名称:use-knife-solo-instead-chef-solo-day13,代码行数:24,代码来源:fleamarket.php


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