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


PHP R::exportAll方法代码示例

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


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

示例1: postRankings

function postRankings($classId, $rankings)
{
    $class = R::load(SHOWCLASS, $classId);
    if (!$class->id) {
        return null;
    }
    $participations = R::exportAll($class->ownParticipation);
    if ($participations == null) {
        return null;
    }
    foreach ($rankings as $key => $value) {
        $riderId = $value->id;
        $rank = $value->rank;
        if ($riderId == null || $rank == null) {
            return null;
        }
        $rider = R::load(USER, $riderId);
        if (!$rider->id) {
            continue;
        }
        foreach ($participations as $participationGetter) {
            $participation = R::load(PARTICIPATION, $participationGetter[ID]);
            if ($participation->rider_id == $riderId) {
                $participation->rank = $rank;
                R::store($participation);
                break;
            }
        }
    }
    return R::store($class);
}
开发者ID:rileyteige,项目名称:MyHorseShow-Server,代码行数:31,代码来源:classes.php

示例2: index

 function index($f3)
 {
     $D = \R::find($this->model_name(), 'ORDER BY displayname ASC');
     if ($D) {
         $f3->set('data', \R::exportAll($D));
     } else {
         $f3->set('data', '');
     }
     show_page($f3, $this->template_name() . '.index');
 }
开发者ID:neyre,项目名称:tools.olin.edu,代码行数:10,代码来源:base.php

示例3: getList

 /**
  * Return all records for a type
  * @param string $type Database table
  * @return string JSON All of the records and their contents
  * @throws API\Exceptions\APIException No records found, 404
  */
 public static function getList($type)
 {
     $beans = R::find($type);
     $response = R::exportAll($beans);
     if (sizeof($response) > 0) {
         return new JSON(array("data" => $response));
     } else {
         throw new APIException("No " . $type . " records found.", 404);
     }
 }
开发者ID:paulosouzainfo,项目名称:PHP-RapidREST,代码行数:16,代码来源:RapidRest.php

示例4: index

 function index($f3)
 {
     $D = \R::findOne('tools', 'name=?', array($f3->get('PARAMS.name')));
     if ($D) {
         $exportTmp = \R::exportAll($D);
         $f3->set('data', $exportTmp[0]);
     } else {
         $f3->set('data', '');
     }
     show_page($f3, $this->template_name() . '.index');
 }
开发者ID:neyre,项目名称:tools.olin.edu,代码行数:11,代码来源:docs.php

示例5: testbook

function testbook()
{
    global $app;
    try {
        $book = R::findAll('book');
        // 				var_dump($book);
        echo json_encode(R::exportAll($book));
    } catch (Exception $e) {
        $app->response()->status(400);
        $app->response()->header('X-Status-Reason', $e->getMessage());
    }
}
开发者ID:limweb,项目名称:webappservice,代码行数:12,代码来源:books.php

示例6: getIndice

 function getIndice($idsubmenu)
 {
     //$indices = R::findAll( 'indice', "submenu_id = ?", array($idsubmenu));
     //$indices = R::find( 'indice', "submenu_id = ? ORDER BY id DESC", array($idsubmenu));
     //$indices = R::find( 'indices', "submenu_id = ?", array($idsubmenu));
     //echo $indices;
     //return $indices->export();
     $indices = R::find('indice', ' submenu_id = ? ORDER BY titulo ASC', array($idsubmenu));
     //$indices = R::load( 'indice', 1 );
     //return $indices->exportAll;
     return R::exportAll($indices);
 }
开发者ID:spoooner12345,项目名称:arqui-backend,代码行数:12,代码来源:submenu_model.php

示例7: get_BasicInfo

 public function get_BasicInfo($ProductId)
 {
     try {
         $product = R::find('product', 'id=?', array($ProductId));
         if (!isset($product) || empty($product)) {
             throw new RecordNotFoundException("Record not found, id:" . $ProductId);
         }
         echo ResponseJsonHandler::normalizeJsonResponse(R::exportAll($product));
     } catch (Exception $ex) {
         return ExceptionHandler::Response($ex, $this->_app);
     }
 }
开发者ID:WTer,项目名称:NJB,代码行数:12,代码来源:Product.php

示例8: info

 function info($f3)
 {
     $toolgroups = \R::findAll('toolgroups', 'ORDER BY sort_priority DESC, displayname ASC');
     foreach ($toolgroups as $key => $element) {
         $toolgroups[$key]->with("ORDER BY displayname ASC")->ownTools;
     }
     $f3->set('toolgroups', \R::exportAll($toolgroups));
     $user = \R::findOne('users', 'username=?', array($this->username));
     $f3->set('user', $user);
     $trainings = \R::find('trainings', 'users_id=?', array($user->id));
     $f3->set('trainings', $trainings ? reset($trainings)->build_lookup($trainings) : false);
     show_page($f3, 'user');
 }
开发者ID:neyre,项目名称:tools.olin.edu,代码行数:13,代码来源:users.php

示例9: index

 function index($f3)
 {
     $tools = \R::find('tools');
     $D = \R::findAll('toolgroups', 'ORDER BY sort_priority DESC, displayname ASC');
     foreach ($D as $key => $element) {
         $D[$key]->with("ORDER BY displayname ASC")->ownTools;
     }
     $f3->set('toolgroups', \R::exportAll($D));
     $trainings = \R::find('trainings');
     $f3->set('trainings', $trainings ? reset($trainings)->build_lookup($trainings) : false);
     $users = \R::find('users', 'active=1 ORDER BY usergroup ASC, displayname ASC');
     $f3->set('usergroups', $users ? reset($users)->group($users) : $users);
     show_page($f3, 'trainings.index', true);
 }
开发者ID:neyre,项目名称:tools.olin.edu,代码行数:14,代码来源:trainings.php

示例10: get

 function get($clientid = NULL, $id = NULL)
 {
     if ($clientid != NULL) {
         $client = R::load('client', $clientid);
         if ($id === NULL) {
             return $client->with(' ORDER BY pos ASC ')->ownMenu;
         } else {
             return $client->ownMenu[$id];
         }
     } else {
         $menu = R::load("menu", $id);
         return R::exportAll($menu);
     }
 }
开发者ID:spoooner12345,项目名称:arqui-backend,代码行数:14,代码来源:menu_model.php

示例11: edit_form

 function edit_form($f3)
 {
     // Get Toolgroup Options
     $D = \R::findAll('toolgroups', 'ORDER BY sort_priority DESC, displayname ASC');
     $f3->set('toolgroups', \R::exportAll($D));
     // Get Training Levels
     $f3->set('training_levels', $f3->exists('data.training_levels') ? json_decode($f3->get('data.training_levels')) : $f3->get('TRAINING_LEVELS'));
     // Get Location Options
     $D = \R::findAll('locations', 'ORDER BY displayname ASC');
     $f3->set('locations', \R::exportAll($D));
     foreach ($f3->get('locations') as $i => $location) {
         $f3->set('locations.' . $i . '.active', isset($this->D->sharedLocationsList[$locations['id']]));
     }
     parent::edit_form($f3);
 }
开发者ID:neyre,项目名称:tools.olin.edu,代码行数:15,代码来源:tools.php

示例12: testCopyRecursion

 /**
  * Test whether recursion happens
  */
 public function testCopyRecursion()
 {
     $document = R::dispense('document');
     $id = R::store($document);
     $document->ownDocument[] = $document;
     R::store($document);
     $duplicate = R::dup($document);
     R::store($duplicate);
     $duplicate = R::load('document', $id);
     asrt((int) $document->document_id, $id);
     asrt((int) $duplicate->document_id, $id);
     // Export variant
     $duplicate = R::exportAll($document);
     asrt((int) $duplicate[0]['document_id'], $id);
 }
开发者ID:daviddeutsch,项目名称:redbean-adaptive,代码行数:18,代码来源:Copy.php

示例13: getbyid

function getbyid($id)
{
    global $app;
    try {
        $article = R::findOne('articles', 'id=?', array($id));
        if ($article) {
            echo json_encode(R::exportAll($article));
        } else {
            throw new ResourceNotFoundException();
        }
    } catch (ResourceNotFoundException $e) {
        $app->response()->status(404);
    } catch (Exception $e) {
        $app->response()->status(400);
        $app->response()->header('X-Status-Reason', $e->getMessage());
    }
}
开发者ID:limweb,项目名称:webappservice,代码行数:17,代码来源:samplecrud.php

示例14: post

 public function post()
 {
     try {
         /*$requestBody = $app->request->getBody();
         		$requestJson = json_decode($requestBody, true);*/
         $requestJson = RequestBodyHandler::getJsonBody($this->_app);
         RequestBodyHandler::verifyJsonBody($requestJson, array("ProductId", "Comment", "ConsumerId"));
         $obj = R::dispense('productcomment');
         $obj->productid = $requestJson->ProductId;
         $obj->comment = $requestJson->Comment;
         $obj->consumerid = $requestJson->ConsumerId;
         $obj->lastmodifiedtime = now();
         $id = R::store($obj);
         $response = R::find('productcomment', 'id=?', array($id));
         echo ResponseJsonHandler::normalizeJsonResponse(R::exportAll($response));
         //sendSuccess(json_encode(R::exportAll($obj)), 201);
     } catch (Exception $ex) {
         return ExceptionHandler::Response($ex, $this->_app);
     }
 }
开发者ID:WTer,项目名称:NJB,代码行数:20,代码来源:ProductComment.php

示例15: function

$app->get('/schoolContract', function () use($app) {
    $sql = "select agent.oname as oname, contract.price as price, school.* from contract" . " join agent on agent.aid = contract.aid join school on school.id = contract.sid";
    try {
        $result = R::getAll($sql);
        $data = R::convertToBeans('contract', $result);
        success(R::exportAll($data));
    } catch (RedBeanPHP\RedException\SQL $e) {
        fail($e);
    }
});
$app->get('/student/:id', function ($id) use($app) {
    $sql = "select school.name as sname, user.* from school join user on user.sid='" . $id . "'";
    try {
        $result = R::getAll($sql);
        $data = R::convertToBeans('user', $result);
        success(R::exportAll($data));
    } catch (RedBeanPHP\RedException\SQL $e) {
        fail($e);
    }
});
$app->get('/', function () use($app) {
    header("Location: intro.php");
    die;
});
function setUnique($bean, $arr)
{
    $bean->setMeta("buildcommand.unique", array($arr));
}
function safeStore($obj)
{
    try {
开发者ID:rbrb,项目名称:smartqna,代码行数:31,代码来源:index.php


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