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


PHP Sequence::getNewId方法代码示例

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


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

示例1: beforeSave

 public function beforeSave($data)
 {
     $defaults = array();
     $files = array();
     // set new sequential ID
     $sequence = new Sequence();
     $seq = $sequence->getNewId('property');
     $data['sequence'] = $seq;
     $data['propertyId'] = Config::get('ia.property_id_prefix') . $seq;
     if ($data['submit'] == 'Publish') {
         $data['publishStatus'] = 'published';
     } else {
         $data['publishStatus'] = 'draft';
     }
     $data['publishDate'] = $data['lastUpdate'];
     if (isset($data['file_id']) && count($data['file_id'])) {
         $data['defaultpic'] = isset($data['defaultpic']) ? $data['defaultpic'] : $data['file_id'][0];
         for ($i = 0; $i < count($data['thumbnail_url']); $i++) {
             if ($data['defaultpic'] == $data['file_id'][$i]) {
                 $defaults['thumbnail_url'] = $data['thumbnail_url'][$i];
                 $defaults['large_url'] = $data['large_url'][$i];
                 $defaults['medium_url'] = $data['medium_url'][$i];
             }
             $files[$data['file_id'][$i]]['thumbnail_url'] = $data['thumbnail_url'][$i];
             $files[$data['file_id'][$i]]['large_url'] = $data['large_url'][$i];
             $files[$data['file_id'][$i]]['medium_url'] = $data['medium_url'][$i];
             $files[$data['file_id'][$i]]['delete_type'] = $data['delete_type'][$i];
             $files[$data['file_id'][$i]]['delete_url'] = $data['delete_url'][$i];
             $files[$data['file_id'][$i]]['filename'] = $data['filename'][$i];
             $files[$data['file_id'][$i]]['filesize'] = $data['filesize'][$i];
             $files[$data['file_id'][$i]]['temp_dir'] = $data['temp_dir'][$i];
             $files[$data['file_id'][$i]]['filetype'] = $data['filetype'][$i];
             $files[$data['file_id'][$i]]['fileurl'] = $data['fileurl'][$i];
             $files[$data['file_id'][$i]]['file_id'] = $data['file_id'][$i];
             $files[$data['file_id'][$i]]['caption'] = $data['caption'][$i];
         }
     } else {
         $data['thumbnail_url'] = array();
         $data['large_url'] = array();
         $data['medium_url'] = array();
         $data['delete_type'] = array();
         $data['delete_url'] = array();
         $data['filename'] = array();
         $data['filesize'] = array();
         $data['temp_dir'] = array();
         $data['filetype'] = array();
         $data['fileurl'] = array();
         $data['file_id'] = array();
         $data['caption'] = array();
         $data['defaultpic'] = '';
     }
     $data['defaultpictures'] = $defaults;
     $data['files'] = $files;
     return $data;
 }
开发者ID:awidarto,项目名称:tmadminflat,代码行数:55,代码来源:TransactionController.php

示例2: getGenpdf

 public function getGenpdf()
 {
     $this->pdf = true;
     $tables = $this->getIndex();
     $this->table_raw = $tables;
     $this->report_entity = false;
     $sequencer = new Sequence();
     $doc_number = $sequencer->getNewId('devmanifest');
     $this->additional_filter = View::make(strtolower($this->controller_name) . '.addhead')->with('doc_number', $doc_number)->render();
     $this->report_file_name = 'MDL-' . str_pad($doc_number, 5, '0', STR_PAD_LEFT) . '.html';
     $this->report_file_path = realpath('storage/docs') . '/devmanifest/';
     $this->title = 'MANIFEST PENGIRIMAN HARIAN - TO DEVICE / LOGISTIC';
     $this->report_type = 'devmanifest';
     return parent::printReport();
 }
开发者ID:awidarto,项目名称:jexadmin,代码行数:15,代码来源:DevmanifestController.php

示例3: function

    $content = View::make('print.brochure')->with('prop',$prop)->render();

    //return $content;

    return PDF::loadView('print.brochure',array('prop'=>$prop))
        ->stream('download.pdf');
});

Route::get('brochure',function(){
    View::make('print.brochure');
});
*/
Route::get('inc/{entity}', function ($entity) {
    $seq = new Sequence();
    print_r($seq->getNewId($entity));
});
Route::get('last/{entity}', function ($entity) {
    $seq = new Sequence();
    print $seq->getLastId($entity);
});
Route::get('init/{entity}/{initial}', function ($entity, $initial) {
    $seq = new Sequence();
    print_r($seq->setInitialValue($entity, $initial));
});
Route::get('hashme/{mypass}', function ($mypass) {
    print Hash::make($mypass);
});
Route::get('xtest', function () {
    Excel::load('WEBSITE_INVESTORS_ALLIANCE.xlsx')->calculate()->dump();
});
开发者ID:awidarto,项目名称:tmadminflat,代码行数:30,代码来源:routes.php

示例4: beforeImportCommit

 public function beforeImportCommit($data)
 {
     $defaults = array();
     $files = array();
     if ($data['propertyId'] == '') {
         $sequence = new Sequence();
         $seq = $sequence->getNewId('property');
         $data['sequence'] = $seq;
         $data['propertyId'] = Config::get('ia.property_id_prefix') . $seq;
     }
     // set new sequential ID
     if ($data['propertyStatus'] == 'available') {
         $data['publishDate'] = $data['lastUpdate'];
     }
     if ($data['propertyStatus'] == 'sold') {
         $data['soldDate'] = $data['lastUpdate'];
     }
     $data['listingPrice'] = new MongoInt32($data['listingPrice']);
     $data['thumbnail_url'] = array();
     $data['large_url'] = array();
     $data['medium_url'] = array();
     $data['full_url'] = array();
     $data['delete_type'] = array();
     $data['delete_url'] = array();
     $data['filename'] = array();
     $data['filesize'] = array();
     $data['temp_dir'] = array();
     $data['filetype'] = array();
     $data['fileurl'] = array();
     $data['file_id'] = array();
     $data['caption'] = array();
     $data['defaultpic'] = '';
     $data['brchead'] = '';
     $data['brc1'] = '';
     $data['brc2'] = '';
     $data['brc3'] = '';
     $data['defaultpictures'] = array();
     $data['files'] = array();
     return $data;
 }
开发者ID:awidarto,项目名称:tmadminflat,代码行数:40,代码来源:PropertyController.php


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