本文整理汇总了PHP中Application::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::create方法的具体用法?PHP Application::create怎么用?PHP Application::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::create方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
DB::table('applications')->delete();
User::create(['date', 'position', 'description', 'company', 'contact_name', 'contact_title', 'phone', 'fax', 'email', 'address', 'website', 'application_method', 'heard_about', 'status', 'references']);
Application::create(array('date' => '04/15/15', 'position' => 'Sales Associate', 'description' => 'Inform customers about our new products and services', 'company' => 'ABC Decor', 'address' => '3572 N. Professional Avenue', 'contact_name' => 'John Femont', 'contact_title' => 'Regional Supervisor', 'phone' => '509-442-7564', 'fax' => '509-442-7565', 'email' => 'jfemont@abcdecor.com', 'website' => 'http://www.abcdecor.com', 'application_method' => 'Faxed Resume', 'heard_about' => 'Colleague', 'status' => 'Pending Interview', 'references' => 'Tommy Regal'));
Application::create(array('date' => '04/15/15', 'position' => 'Community Event Organizer', 'description' => 'Assist ACB with scheduling and organization local community events', 'company' => 'ACB Event Specialists', 'address' => '6372 N. Epic St', 'contact_name' => 'Crystal Denoma', 'contact_title' => 'ACB Manager', 'phone' => '509-947-5743', 'fax' => '509-947-6382', 'email' => 'cdenoma@acbevents.org', 'website' => 'http://www.acbevents.org', 'application_method' => 'Indeed.com', 'heard_about' => 'Job Board', 'status' => 'Interviewed', 'references' => 'None'));
}
示例2: run
public function run()
{
$faker = Faker::create();
foreach (range(1, 500) as $index) {
Application::create(['name' => $faker->word, 'url' => $faker->url]);
}
}
示例3: startCase
public function startCase($sTasUid, $sUsrUid, $isSubprocess = false, $dataPreviusApplication = array())
{
if ($sTasUid != '') {
try {
$task = TaskPeer::retrieveByPK($sTasUid);
if (is_null($task)) {
throw new Exception(G::LoadTranslation("ID_TASK_NOT_EXIST", array("TAS_UID", $sTasUid)));
}
//To allow Self Service as the first task
$arrayTaskTypeToExclude = array("START-TIMER-EVENT");
if (!is_null($task) && !in_array($task->getTasType(), $arrayTaskTypeToExclude) && $task->getTasAssignType() != "SELF_SERVICE" && $sUsrUid == "") {
throw (new Exception('You tried to start a new case without send the USER UID!'));
}
//Process
$sProUid = $task->getProUid();
$this->Process = new Process;
$proFields = $this->Process->Load($sProUid);
//application
$Application = new Application;
$sAppUid = $Application->create($sProUid, $sUsrUid);
//appDelegation
$AppDelegation = new AppDelegation;
$iAppThreadIndex = 1; // Start Thread
$iAppDelPrio = 3; // Priority
$iDelIndex = $AppDelegation->createAppDelegation(
$sProUid, $sAppUid, $sTasUid, $sUsrUid, $iAppThreadIndex, $iAppDelPrio, $isSubprocess
);
//appThread
$AppThread = new AppThread;
$iAppThreadIndex = $AppThread->createAppThread($sAppUid, $iDelIndex, 0);
//DONE: Al ya existir un delegation, se puede "calcular" el caseTitle.
$Fields = $Application->toArray(BasePeer::TYPE_FIELDNAME);
$aApplicationFields = $Fields['APP_DATA'];
$newValues = $this->newRefreshCaseTitleAndDescription($sAppUid, $Fields, $aApplicationFields);
if (!isset($newValues['APP_TITLE'])) {
$newValues['APP_TITLE'] = '';
}
$caseNumber = $Fields['APP_NUMBER'];
$Application->update($Fields);
//Update the task last assigned (for web entry and web services)
//.........这里部分代码省略.........
示例4: setUp
public function setUp()
{
$autoloader = (require __DIR__ . '/../../vendor/autoload.php');
$this->appPkg = Application::create($autoloader)->addExtension(__DIR__ . '/../..')->bootstrap(Event\Type\Dummy::create());
}
示例5: startCase
public function startCase($sTasUid, $sUsrUid, $isSubprocess = false)
{
if ($sTasUid != '') {
try {
$this->Task = new Task();
$Fields = $this->Task->Load($sTasUid);
//To allow Self Service as the first task
if ($Fields['TAS_ASSIGN_TYPE'] != 'SELF_SERVICE' && $sUsrUid == '') {
throw new Exception('You tried to start a new case without send the USER UID!');
}
//Process
$sProUid = $this->Task->getProUid();
$this->Process = new Process();
$proFields = $this->Process->Load($sProUid);
//application
$Application = new Application();
$sAppUid = $Application->create($sProUid, $sUsrUid);
//appDelegation
$AppDelegation = new AppDelegation();
$iAppThreadIndex = 1;
// Start Thread
$iAppDelPrio = 3;
// Priority
$iDelIndex = $AppDelegation->createAppDelegation($sProUid, $sAppUid, $sTasUid, $sUsrUid, $iAppThreadIndex, $iAppDelPrio, $isSubprocess);
//appThread
$AppThread = new AppThread();
$iAppThreadIndex = $AppThread->createAppThread($sAppUid, $iDelIndex, 0);
//DONE: Al ya existir un delegation, se puede "calcular" el caseTitle.
$Fields = $Application->toArray(BasePeer::TYPE_FIELDNAME);
$aApplicationFields = $Fields['APP_DATA'];
$newValues = $this->newRefreshCaseTitleAndDescription($sAppUid, $Fields, $aApplicationFields);
if (!isset($newValues['APP_TITLE'])) {
$newValues['APP_TITLE'] = '';
}
$caseNumber = $Fields['APP_NUMBER'];
$Application->update($Fields);
//Update the task last assigned (for web entry and web services)
G::LoadClass('derivation');
$oDerivation = new Derivation();
$oDerivation->setTasLastAssigned($sTasUid, $sUsrUid);
//update searchindex
if ($this->appSolr != null) {
$this->appSolr->updateApplicationSearchIndex($sAppUid);
}
} catch (exception $e) {
throw $e;
}
} else {
throw new Exception('You tried to start a new case without send the USER UID or TASK UID!');
}
//call plugin
if (class_exists('folderData')) {
$folderData = new folderData($sProUid, $proFields['PRO_TITLE'], $sAppUid, $newValues['APP_TITLE'], $sUsrUid);
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$oPluginRegistry->executeTriggers(PM_CREATE_CASE, $folderData);
}
//end plugin
return array('APPLICATION' => $sAppUid, 'INDEX' => $iDelIndex, 'PROCESS' => $sProUid, 'CASE_NUMBER' => $caseNumber);
}
示例6: create
/**
* Create new Application
* @param string $key
* @param string $secret
* @return Application
*/
public function create($name, $key, $secret)
{
return $this->application->create(["name" => $name, "key" => $key, "secret" => $secret]);
}
示例7: Application
$t->is($e->getMessage(), "Error in setAppTitle, the APP_UID can't be blank", 'setAppTitle() return Error in getAppTitle, the APP_UID cant be blank');
}
//create
try {
$obj = new Application();
$res = $obj->create();
} catch (Exception $e) {
//#14
$t->isa_ok($e, 'PropelException', 'create() return error when APP_UID is not defined');
//#15
$t->like($e->getMessage(), "%Unable to execute INSERT statement%", 'getAppTitle() return Error in getAppTitle, the APP_UID cant be blank');
}
//create
try {
$obj = new Application();
$appUid = $obj->create('1');
//#16
$t->isa_ok($appUid, 'string', 'create(), creates a new application');
//#17
$t->is(strlen($appUid), 14, 'create(), creates a new application, Guid lenth=14 chars');
$res = $obj->load($appUid);
//#18
$t->isa_ok($res, 'array', 'load(), loads a new application');
//#19
$t->is($res['APP_UID'], $appUid, 'load(), loads a new application, valid APP_UID');
//#20
$t->is($res['APP_FINISH_DATE'], '1902-01-01 00:00:00', 'load(), loads a new application, valid FINISH_DATE');
//#21
$t->like($res['APP_TITLE'], '%#%', 'load(), loads a new application, valid APP_TITLE');
//#22
$t->is($res['APP_PARENT'], '', 'load(), loads a new application, valid APP_PARENT');
示例8: define
<?php
// putenv('DEBUG=1');
define('APP_PATH', __DIR__);
require APP_PATH . '/../../vendor/autoload.php';
require APP_PATH . '/lib/cover/Module.php';
require APP_PATH . '/lib/blog/Module.php';
require APP_PATH . '/lib/about/Module.php';
class Application extends Server\Application
{
public function __construct(Server\LayerInterface $next = null, array $config = array(), array $env = array())
{
parent::__construct($next, $config, $env);
$this->employ(['class' => 'Server\\Middleware\\Renderer'])->employ(['class' => 'About\\Module', 'pattern' => '/about*uri'])->employ(['class' => 'Blog\\Module', 'pattern' => '/blog*uri'])->employ(['class' => 'Cover\\Module']);
}
public function getMenuHtml()
{
return '<div class="xs-max-size"><div class="nav trinity rule-after">' . '<div class="nav-left">' . '<a class="button" href="' . $this->master->getRealPath('/') . '">' . $this->config['title'] . '</a>' . '<a class="button" href="' . $this->master->getRealPath('/blog') . '">Blog</a>' . '<a class="button" href="' . $this->master->getRealPath('/about') . '">About</a>' . '</div></div></div>';
}
public function getHeader($pageTitle = null)
{
return '<html><head><meta charset="utf-8"><title>' . (($pageTitle ? $pageTitle . ' – ' : '') . $this->config['title']) . '</title><link rel="stylesheet" href="http://localhost/~mariuslundgard/body/dist/body.css"></head><body class="no-margin">';
}
public function getFooter()
{
return '</head></html>';
}
}
Application::create(null, ['title' => 'A Personal Site', 'basePath' => '/~mariuslundgard/php-server/example/personal'], $_SERVER)->call()->send();
示例9: Application
function new_app()
{
if ($this->session_handler->is_logged_in()) {
$application = new Application();
$application->app_name = $this->input->post('apptitle', TRUE);
$application->version = "";
$application->description = $this->input->post('description', TRUE);
$application->package_name = "";
$application->cat_id = $this->input->post('category', TRUE);
$application->price = trim($this->input->post('amount')) == "" ? 0 : $this->input->post('amount', TRUE);
$application->upd_time = time();
$application->website = $this->input->post('website', TRUE);
$application->apk_path = "";
$application->icon_path = "";
$application->status = $this->input->post('status') == "publish" ? 1 : 0;
$application->dev_id = $this->input->post('dev_id');
if ($application->create()) {
$data['title'] = "Add | " . $application->app_name . " | LoveWorld App Store";
$this->session_handler->setFlashMessage("Your new application has been saved");
$data['application'] = $application;
$data['this_user'] = $this->developer->find_by_id($this->session_handler->user_id);
$this->load->view('upload_app', $data);
} else {
$this->session_handler->setFlashMessage("Could not save your application.");
header('Location: add');
}
} else {
$msg = "You must log in first.";
$this->session_handler->setFlashMessage($msg);
header('Location: login');
exit;
}
#-------------------------------------------------
# Parse apk to extract package name and version
# echo "Parsing apk file...<br />";
#-------------------------------------------------
}