本文整理汇总了PHP中Data类的典型用法代码示例。如果您正苦于以下问题:PHP Data类的具体用法?PHP Data怎么用?PHP Data使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Data类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getForeignRecord
/**
* @param string $source Name of foreign source (ex., "people")
* @param array $constraints Array of key/value constraints (ex., "id" => 1)
* @return array
*/
protected function getForeignRecord($source, array $constraints = [])
{
// @todo Cache foreign records instead of reading off disk every time
$sourceForeign = $this->source->parent()->child("{$source}.json");
$dataForeign = new Data($sourceForeign);
return $dataForeign->getRecords($constraints);
}
开发者ID:huxtable,项目名称:core,代码行数:12,代码来源:Data.php
示例2: indexAction
public function indexAction()
{
// Get, check and setup the parameters
if (!($widget_id = $this->getRequest()->getParam("id"))) {
throw new Stuffpress_Exception("No widget id provided to the widget controller");
}
// Verify if the requested widget exist and get its data
$widgets = new Widgets();
if (!($widget = $widgets->getWidget($widget_id))) {
throw new Stuffpress_Exception("Invalid widget id");
}
// Get the last comments
$comments = new Comments(array(Stuffpress_Db_Table::USER => $widget['user_id']));
$mycomments = $comments->getLastComments();
$data = new Data();
// Prepare the comments for output
foreach ($mycomments as &$comment) {
$time = strtotime($comment['timestamp']);
$item = $data->getItem($comment['source_id'], $comment['item_id']);
$comment['item'] = $item;
$comment['when'] = Stuffpress_Date::ago($time, "j M y");
$comment['comment'] = str_replace("\n", " ", $comment['comment']);
if (strlen($comment['comment']) > 50) {
$comment['comment'] = mb_substr($comment['comment'], 0, 47) . "...";
}
}
// Get the widget properties
$properties = new WidgetsProperties(array(Properties::KEY => $widget_id));
$title = $properties->getProperty('title');
$this->view->title = $title ? $title : "Latest comments";
// Prepare the view for rendering
$this->view->comments = $mycomments;
}
开发者ID:kreativmind,项目名称:storytlr,代码行数:33,代码来源:LastcommentsController.php
示例3: setWhere
/**
*
* @param \petry\database\Data $data
* @param type $operator
* @return \petry\database\Update
*/
protected function setWhere(Data $data, $operator = 'AND')
{
$op = is_null($this->where) ? ' WHERE' : ' ' . $operator . ' ';
$this->where .= $op . ' ' . $data->getVariable() . $data->getOperator() . ' :' . $data->getVariable();
$this->whereBindValue[] = $data;
return $this;
}
开发者ID:fernandopetry,项目名称:pwork,代码行数:13,代码来源:UpdateAbstract.php
示例4: build
/**
* @param $parts
* @param $value
* @return Data
*/
public static function build($parts, $value)
{
$data = new Data();
$data->setPath($parts);
$data->setValue($value);
return $data;
}
开发者ID:label305,项目名称:dug,代码行数:12,代码来源:Data.php
示例5: watch
function watch()
{
$returnStr = $this->showHeader(Language::messageSMSTitle());
$returnStr .= $this->displayComboBox();
$returnStr .= "<form method='post'>";
$params = getSessionParams();
//$params['reportpage'] = 'reportRes';
$returnStr .= setSessionParamsPost($params);
$returnStr .= '<div id="wrap">';
$returnStr .= '<div class="container"><p>';
$returnStr .= '<div class="panel panel-default">
<div class="panel-heading">';
$returnStr .= '<h4>' . Language::linkWatch() . '</h4>';
$returnStr .= ' </div>
<div class="panel-body">';
require_once 'data.php';
require_once 'display.php';
$data = new Data();
$values = $data->getRespondentData(getFromSessionParams('watchsuid'), getFromSessionParams('watchprimkey'));
$returnStr .= '</div>
<div role="panel" class="panel">';
if (sizeof($values) == 0) {
$returnStr .= "<br/>" . '<div class="alert alert-warning">' . Language::labelWatchNoData() . '</div>';
} else {
$returnStr .= $this->displayDataTablesScripts(array("colvis", "rowreorder"));
$returnStr .= "<script type='text/javascript'>\n \$(document).ready(function(){\n \$('#issuetable').dataTable(\n {\n \"iDisplayLength\": 5,\n dom: 'C<\"clear\">lfrtip',\n searching: false,\n paging: true\n } \n );\n \n });</script>\n\n ";
//
$returnStr .= "<br/><table id='issuetable' class='table table-bordered table-striped'><thead>";
$returnStr .= "<th>" . Language::labelWatchVariable() . "</th><th>" . Language::labelWatchValue() . "</th><th>" . Language::labelWatchClean() . "</th><th>" . Language::labelWatchMode() . "</th><th>" . Language::labelWatchLanguage() . "</th><th>" . Language::labelWatchTime() . "</th></tr>";
$returnStr .= "</thead><tbody>";
$modes = Common::surveyModes();
$languages = Language::getLanguagesArray();
$sesid = session_id();
require_once 'object.php';
require_once 'component.php';
require_once 'setting.php';
require_once 'type.php';
require_once 'variabledescriptive.php';
$survey = new Survey(getFromSessionParams('watchsuid'));
foreach ($values as $is) {
$returnStr .= "<tr>";
$returnStr .= "<td>" . $is["variablename"] . "</td>";
$returnStr .= "<td>" . $this->getDisplayValue($survey->getVariableDescriptiveByName($is["variablename"]), $is["answer_dec"]) . "</td>";
$returnStr .= "<td>" . $this->displayDirty([$is["dirty"]]) . "</td>";
$returnStr .= "<td>" . $modes[$is["mode"]] . "</td>";
$returnStr .= "<td>" . $languages[str_replace("_", "", getSurveyLanguagePostFix($is["language"]))]['name'] . "</td>";
$returnStr .= "<td>" . $is["ts"] . "</td>";
$returnStr .= "</tr>";
}
$returnStr .= "</tbody></table>";
}
$returnStr .= '</div>
</div>
</div>';
$returnStr .= ' </div></div>';
$returnStr .= '</p></div> </div>';
//container and wrap
$returnStr .= $this->showFooter(false);
echo $returnStr;
}
开发者ID:nubissurveying,项目名称:nubis,代码行数:60,代码来源:watchwindow.php
示例6: formatData
public function formatData()
{
// The file "pb_proto_person.php" was created with the following code:
// require_once(dirname(__FILE__) . '/../libs/protocolbuf/parser/pb_parser.php');
// $filename = dirname(__FILE__) . '/person.proto';
// $parser = new PBParser();
// $parser->parse($filename);
$array = new Data();
$data = $this->getData();
while ($entry = $data->next()) {
$person = $array->add_person();
$person->set_entryId(intval($entry['id']));
$person->set_firstName($entry['first_name']);
$person->set_lastName($entry['last_name']);
$person->set_phone($entry['phone']);
$person->set_email($entry['email']);
$person->set_address($entry['address']);
$person->set_city($entry['city']);
$person->set_zip($entry['zip']);
$person->set_state($entry['state']);
$person->set_country($entry['country']);
$person->set_description($entry['description']);
$person->set_password($entry['password']);
$person->set_createdOn($entry['created_on']);
$person->set_modifiedOn($entry['modified_on']);
}
return $array->SerializeToString();
}
开发者ID:rotten4pple,项目名称:iPhoneWebServicesClient,代码行数:28,代码来源:protocolbufferformatter.php
示例7: table
public static function table($name)
{
$file = new Data();
$file->name = $name;
$file->setType('data');
return $file;
}
开发者ID:chenyongze,项目名称:m3d,代码行数:7,代码来源:Data.php
示例8: testPerform
/**
* @return void
*/
public function testPerform()
{
$data = new Data($this->progress, $this->source, $this->destination, $this->recordFactory, $this->helper);
$this->assertTrue($data->perform());
foreach ($this->destinationDocuments as $documentName => $recordsCount) {
$this->assertEquals($recordsCount, count($this->destination->getRecords($documentName, 0)));
}
}
开发者ID:Mohitsahu123,项目名称:data-migration-tool-ce,代码行数:11,代码来源:DataTest.php
示例9: waw2Data
public function waw2Data()
{
$Data = new Data();
$w2 = $this->dateFormat($Data->getWaw2());
$day = substr($w2, 0, 2);
$day2 = (int) $day + 1;
$w2 = $day . "-" . $day2 . substr($w2, 2);
return $w2;
}
开发者ID:Budaa,项目名称:TydzienMody_New,代码行数:9,代码来源:Form.php
示例10: linkEdit
public static function linkEdit(Data $data, $textLink)
{
$baseUrl = LinkController::getBaseURL();
$idData = $data->getId();
$link = "<a href='{$baseUrl}/admin/datacenter/dado/edit/{$idData}'>";
$link .= $textLink;
$link .= "</a>";
echo $link;
}
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:9,代码来源:DatacenterHelper.php
示例11: checkNumData
public function checkNumData($agency_code, $data_id)
{
$data_obj = new Data();
$arr_data[] = $data_id;
$data_info = $data_obj->getDataInfo($arr_data);
$table_name = $data_info[0]->table_name;
list($table, $field, $datefield) = explode("-", $table_name);
$rs = DB::connection('nhc_data')->table($table)->where('agency_id', '=', $agency_code)->count();
return $rs;
}
开发者ID:nattaphat,项目名称:cuse2,代码行数:10,代码来源:QueryData.php
示例12: rearr
function rearr($array)
{
arrayRecursive($array, 'urlencode', true);
$data = new Data();
$data->setData($array);
$data->setMd5(md5(urldecode(json_encode($array))));
$_SESSION['token'] = md5(time());
$data->setToken($_SESSION['token']);
echo urldecode(json_encode($data));
}
开发者ID:Zocoo,项目名称:zune,代码行数:10,代码来源:json.php
示例13: dashboard
public function dashboard()
{
if (Auth::is_valid()) {
$data = new Data();
$carpeta = new Carpeta();
$this->data = $data->find();
$this->carpetas = $carpeta->get_nombre_carpetas_by_user_id(Auth::get("id"));
$this->obj_carpeta_data = new CarpetaData();
}
}
开发者ID:jaimeirazabal1,项目名称:intercambio_de_perfiles,代码行数:10,代码来源:index_controller.php
示例14: table1Action
public function table1Action()
{
$this->view->disable();
if ($this->request->isAjax() == true) {
$response = new \Phalcon\Http\Response();
$response->setContentType('application/json', 'UTF-8');
$db_data = new Data();
$response->setContent($db_data->get_table_data_json($this->request->getPost(), $this->config->table_1->toArray()));
return $response;
}
}
开发者ID:pjuros,项目名称:php-phalcon-datatables,代码行数:11,代码来源:DataController.php
示例15: turnDataToJson
/**
* @test
*/
public function turnDataToJson()
{
$subgroup = new Subgroup("subgrupo");
$font = new Font("fonte");
$type = new CoffeType("type");
$variety = new Variety("variety", 1);
$origin = new Country("origin");
$destiny = new Country("destiny");
$data = new Data(1990, $subgroup, $font, $type, $variety, $origin, $destiny);
$this->assertEquals($this->jsonExpected(), $data->toJson());
}
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:14,代码来源:DataObjectTest.php
示例16: editpost_post
function editpost_post()
{
$Data = new Data();
if (trim(post('body')) == "") {
print "You must enter a post body.";
} else {
if (!$Data->thread_post_update($_POST, id())) {
print "Your thread was not submitted.";
}
}
exit_clean();
}
开发者ID:jmichaelward,项目名称:pgBoard,代码行数:12,代码来源:post.php
示例17: reply_post
function reply_post()
{
$Data = new Data();
if (trim(post('body')) == "") {
print "You must enter a post body.";
} else {
if (!$Data->thread_post_insert($_POST)) {
print "Your post was not submitted.";
}
}
exit_clean();
}
开发者ID:jmichaelward,项目名称:pgBoard,代码行数:12,代码来源:post.php
示例18: deleteComment
public function deleteComment($id)
{
if (!($comment = $this->getComment($id))) {
return;
}
// Decrease the counter
$data = new Data();
$data->decreaseComments($comment->source_id, $comment->item_id);
// Delete the comment
$where = $this->getAdapter()->quoteInto('id = ?', $id);
$this->delete($where);
}
开发者ID:kreativmind,项目名称:storytlr,代码行数:12,代码来源:Comments.php
示例19: autoCreateIndexes
/**
* 自动给给定集合创建索引
*
* @param string $collection_id
*
*/
public function autoCreateIndexes($collection_id)
{
$cursor = $this->find(array('collection_id' => $collection_id));
$dataCollection = new Data($this->config);
$dataCollection->setCollection(iCollectionName($collection_id));
while ($cursor->hasNext()) {
$index = $cursor->getNext();
$keys = Json::decode($index['keys'], Json::TYPE_ARRAY);
$dataCollection->ensureIndex($keys, array('background' => true));
}
return true;
}
开发者ID:im286er,项目名称:ent,代码行数:18,代码来源:Index.php
示例20: afterSave
public function afterSave()
{
parent::afterSave();
if (count($this->data) == 0) {
foreach (Sector::model()->findAll() as $sector) {
$data = new Data();
$data->metric_id = $this->id;
$data->sector_id = $sector->id;
$data->save();
}
}
}
开发者ID:nizsheanez,项目名称:kur.ru,代码行数:12,代码来源:Metric.php
注:本文中的Data类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论