本文整理汇总了PHP中Step类的典型用法代码示例。如果您正苦于以下问题:PHP Step类的具体用法?PHP Step怎么用?PHP Step使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Step类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
/**
* Add raw step
* @param string $name
* @param callable $executer
* @param integer $units
* @return StepCollection
*/
public function add($name, callable $executer, $units = 1)
{
$step = new Step($name);
$step->setExecuter($executer)->setUnits($units);
$this->addStep($step);
return $this;
}
示例2: deleteInputDoc
public function deleteInputDoc($params)
{
require_once 'classes/model/StepSupervisor.php';
require_once 'classes/model/ObjectPermission.php';
require_once 'classes/model/InputDocument.php';
G::LoadClass('processMap');
$oStepSupervisor = new StepSupervisor();
$fields2 = $oStepSupervisor->loadInfo($params->IDOC_UID);
$oStepSupervisor->remove($fields2['STEP_UID']);
$oPermission = new ObjectPermission();
$fields3 = $oPermission->loadInfo($params->IDOC_UID);
if (is_array($fields3)) {
$oPermission->remove($fields3['OP_UID']);
}
$oInputDocument = new InputDocument();
$fields = $oInputDocument->load($params->IDOC_UID);
$oInputDocument->remove($params->IDOC_UID);
$oStep = new Step();
$oStep->removeStep('INPUT_DOCUMENT', $params->IDOC_UID);
$oOP = new ObjectPermission();
$oOP->removeByObject('INPUT', $params->IDOC_UID);
//refresh dbarray with the last change in inputDocument
$oMap = new processMap();
$oCriteria = $oMap->getInputDocumentsCriteria($params->PRO_UID);
$this->success = true;
$this->msg = G::LoadTranslation('ID_INPUT_DOC_SUCCESS_DELETE');
}
示例3: testGets
/**
* Test getters
*/
public function testGets()
{
$node = $this->getMock('Choccybiccy\\Pathfinder\\NodeInterface');
$parent = new Step($node, null);
$step = new Step($node, $parent);
$this->assertEquals($node, $parent->getNode());
$this->assertEquals($parent, $step->getParent());
}
示例4: registerStep
/**
* @param Step $step
* @param bool $replaceExistingStep
*/
public function registerStep(Step $step, $replaceExistingStep = false)
{
$identifier = $step->getIdentifier();
if (preg_match(static::STEP_IDENTIFIER_PATTERN, $identifier) !== 1) {
throw new \InvalidArgumentException(sprintf('The given step "%s" does not match the step identifier pattern %s.', $identifier, static::STEP_IDENTIFIER_PATTERN), 1437921283);
}
if ($replaceExistingStep === false && isset($this->steps[$identifier])) {
throw new \InvalidArgumentException(sprintf('The given step "%s" was already registered and you did not set the "replaceExistingStep" flag.', $identifier), 1437921270);
}
$this->steps[$step->getIdentifier()]['step'] = $step;
}
示例5: test_save
function test_save()
{
//Arrange
$description = "Buy book on learning French";
$project_id = 1;
$position = 1;
$test_step = new Step($description, $project_id, $position);
//Act
$test_step->save();
//Assert
$result = Step::getAll();
$this->assertEquals([$test_step], $result);
}
示例6: actionReorder
public function actionReorder($id)
{
$traveler = $this->loadModel($id);
if (isset($_POST['position'])) {
Step::model()->sortSteps($_POST['position']);
exit("ok");
}
$this->render('reorder', array('steps' => $traveler->getStepParent(), 'id' => $id));
}
示例7: post
/**
* Implementation for 'POST' method for Rest API
*
* @param mixed $stepUid Primary key
*
* @return array $result Returns array within multiple records or a single record depending if
* a single selection was requested passing id(s) as param
*/
protected function post($stepUid, $proUid, $tasUid, $stepTypeObj, $stepUidObj, $stepCondition, $stepPosition, $stepMode)
{
try {
$result = array();
$obj = new Step();
$obj->setStepUid($stepUid);
$obj->setProUid($proUid);
$obj->setTasUid($tasUid);
$obj->setStepTypeObj($stepTypeObj);
$obj->setStepUidObj($stepUidObj);
$obj->setStepCondition($stepCondition);
$obj->setStepPosition($stepPosition);
$obj->setStepMode($stepMode);
$obj->save();
} catch (Exception $e) {
throw new RestException(412, $e->getMessage());
}
}
示例8: compareTo
/**
* Compares this object with the specified object for order.
* Returns a negative integer, zero, or a positive integer
* as this object is less than, equal to, or greater than the specified object.
*
* WARNING: this comparison assumes the rounds are in the same sequence.
* This means that you CANNOT compare an ExitStep with a regular Step.
* (I mean, you can, but you won't get meaningful results.)
*
* @param Round $round the round to compare to this one
* @return int negative if this round comes before the given one; positive if it comes after; zero if they come at the same time (are the same)
*/
public function compareTo(Round $round)
{
$my_order = $this->step->order();
$their_order = $round->step->order();
if ($my_order == $their_order) {
return $this->repetition - $round->repetition;
} else {
return $my_order - $their_order;
}
}
示例9: loadStep
protected function loadStep($stepId)
{
//if the project property is null, create it based on input id
if ($this->step === null) {
$this->step = Step::model()->findbyPk($stepId);
if ($this->step === null) {
throw new CHttpException(404, 'The requested step does not exist.');
}
}
return $this->step;
}
示例10: __construct
/**
* Class constructor
*
* @param Log $log
* @param Image_API $image_api
*/
public function __construct(Log $log, Image_API $image_api)
{
$this->image_api = $image_api;
parent::__construct($log);
$this->args = ['name' => 'theme', 'title' => __('Theme', 'wp-easy-mode'), 'page_title' => __('Choose a Theme', 'wp-easy-mode'), 'can_skip' => false];
add_action('wpem_print_footer_scripts_' . $this->args['name'], [$this, 'print_footer_scripts']);
$pointer = new Pointer();
$pos = 1;
$count = 2;
if ('store' !== wpem_get_site_type()) {
$count = 3;
$pointer->register(['id' => 'wpem_theme_preview_1', 'target' => '#wpem-header-images-wrapper', 'cap' => 'manage_options', 'options' => ['content' => wp_kses_post(sprintf('<h3>%s</h3><p>%s</p>', sprintf(__('Step %1$s of %2$s', 'wp-easy-mode'), $pos++, $count), __('Choose a stylish header image for your website.', 'wp-easy-mode'))), 'position' => ['edge' => 'left', 'align' => 'right']], 'btn_primary' => __('Next', 'wp-easy-mode'), 'close_on_load' => true, 'next_pointer' => 'wpem_theme_preview_2']);
}
$pointer->register(['id' => 'wpem_theme_preview_2', 'target' => '.wp-full-overlay-header .next-theme', 'cap' => 'manage_options', 'options' => ['content' => wp_kses_post(sprintf('<h3>%s</h3><p>%s</p>', sprintf(__('Step %1$s of %2$s', 'wp-easy-mode'), $pos++, $count), __('Preview different website designs using the the left and right arrows.', 'wp-easy-mode'))), 'position' => ['at' => 'left bottom', 'my' => 'left-63 top']], 'btn_primary' => __('Next', 'wp-easy-mode'), 'close_on_load' => true, 'next_pointer' => 'wpem_theme_preview_3']);
$pointer->register(['id' => 'wpem_theme_preview_3', 'target' => '.button-primary.theme-install', 'cap' => 'manage_options', 'options' => ['content' => wp_kses_post(sprintf('<h3>%s</h3><p>%s</p>', sprintf(__('Step %1$s of %2$s', 'wp-easy-mode'), $pos, $count), __("When you've found a design you like, click Select to install it.", 'wp-easy-mode'))), 'position' => ['at' => 'left bottom', 'my' => 'left-34 top+5']], 'btn_primary' => __('Close', 'wp-easy-mode'), 'btn_primary_close' => true, 'close_on_load' => true]);
$pointer->register_scripts();
}
示例11: getFullById
public function getFullById($id)
{
$db = \Qh\Db_lo::instance();
$getSteps = Step::findByExID($id);
$arr = [':id' => $id];
$sql = 'SELECT * FROM ' . static::TABLE . ' WHERE id = :id';
try {
$send2base = $db->queryObj($sql, static::class, $arr);
if ([] !== $send2base) {
$send2base[0]->ex_steps = $getSteps;
return $send2base[0];
} else {
return false;
}
} catch (\PDOException $exception) {
throw new \App\Exceptions\Db($exception->getMessage());
}
}
示例12: actionCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate()
{
throw new CHttpException(404, 'The requested page does not exist.');
$model = new File();
$issue = null;
if (isset($_GET['discrepancyId'])) {
$discrepancyId = $_GET['discrepancyId'];
$discrepancy = Nonconformity::model()->findByPk($discrepancyId);
$step = $discrepancy->step;
$model->discrepancyId = $discrepancyId;
$issue = Issue::model()->find("id = {$discrepancy->issueId}");
$dir = "discrepancy/";
} elseif (isset($_GET['stepId'])) {
$stepId = $_GET['stepId'];
$step = Step::model()->findByPk($stepId);
$model->stepId = $stepId;
$dir = "step/";
} else {
throw new CHttpException(404, 'The requested page does not exist.');
}
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['File'])) {
$model->attributes = $_POST['File'];
$upload = CUploadedFile::getInstance($model, 'fileSelected');
$rnd = rand(0, 99999);
if (@getimagesize($upload->tempName)) {
$model->image = 1;
} else {
$model->image = 0;
}
$fileName = "{$rnd}-{$upload}";
$model->userId = Yii::app()->user->id;
$model->fileSelected = $upload;
$link = $dir . preg_replace("/[^a-zA-Z0-9\\/_|.-]/", "_", $fileName);
if ($upload->saveAs(Yii::app()->params['dfs'] . "/{$link}")) {
$model->link = $link;
$model->save();
$this->redirect(array('index', 'discrepancyId' => $model->discrepancyId));
}
}
$this->render('create', array('model' => $model, 'step' => $step, 'issue' => $issue, 'discrepancyId' => $discrepancyId));
}
示例13: postCreate
public function postCreate(Request $request)
{
$rules = ['title' => 'required', 'steps' => 'required|array', 'sourcecitations' => 'array'];
// Steps rules
//
if ($request->has('steps')) {
foreach ($request->get('steps') as $key => $val) {
$rules['steps.' . $key . '.title'] = 'required';
$rules['steps.' . $key . '.image'] = 'required_without:steps.' . $key . '.video';
$rules['steps.' . $key . '.video'] = 'required_without:steps.' . $key . '.image';
$rules['steps.' . $key . '.content'] = 'required';
}
}
// Sources & Citation's rules
//
if ($request->has('sourcecitations')) {
foreach ($request->get('sourcecitations') as $key => $val) {
$rules['sourcecitations.' . $key . '.link'] = 'required';
$rules['sourcecitations.' . $key . '.text'] = 'required';
}
}
$validator = Validator::make($request->all(), $rules);
if ($validator->fails()) {
flash($request)->error("Virheitä!");
return redirect()->to('guides/create')->withErrors($validator)->withInput();
}
$guide = Guide::create($request->all());
if ($request->has('steps')) {
foreach ($request->get('steps') as $index => $step) {
Step::create(['guide_id' => $guide->id, 'step' => $index, 'title' => $step['title'], 'content' => $step['content'], 'image' => $step['image'], 'video' => $step['video']]);
}
}
if ($request->has('sourcecitations')) {
foreach ($request->get('sourcecitations') as $sourcecitation) {
SourceCitation::create(['guide_id' => $guide->id, 'text' => $sourcecitation['text'], 'link' => $sourcecitation['link']]);
}
}
// TODO Rest of the creation
}
示例14: Exception
throw new Exception('dbconnections Fatal error, No action defined!...');
}
if (isset($_POST['PROCESS'])) {
$_SESSION['PROCESS'] = $_POST['PROCESS'];
}
#Global Definitions
require_once 'classes/model/DbSource.php';
require_once 'classes/model/Content.php';
$G_PUBLISH = new Publisher();
G::LoadClass('processMap');
G::LoadClass('ArrayPeer');
G::LoadClass('dbConnections');
global $_DBArray;
switch ($action) {
case 'loadInfoAssigConnecctionDB':
$oStep = new Step();
return print $oStep->loadInfoAssigConnecctionDB($_POST['PRO_UID'], $_POST['DBS_UID']);
break;
case 'showDbConnectionsList':
$oProcess = new processMap();
$oCriteria = $oProcess->getConditionProcessList();
if (ProcessPeer::doCount($oCriteria) > 0) {
$aProcesses = array();
$aProcesses[] = array('PRO_UID' => 'char', 'PRO_TITLE' => 'char');
$oDataset = ArrayBasePeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$sProcessUID = '';
while ($aRow = $oDataset->getRow()) {
if ($sProcessUID == '') {
$sProcessUID = $aRow['PRO_UID'];
示例15: Form
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
print $link;
//print "\n<a href='$link' target='_new' > $link </a>";
} else {
$G_FORM = new Form($sPRO_UID . '/' . $sDYNAFORM, PATH_DYNAFORM, SYS_LANG, false);
$G_FORM->action = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/cases_StartExternal.php';
$scriptCode = '';
$scriptCode = $G_FORM->render(PATH_CORE . 'templates/' . 'xmlform' . '.html', $scriptCode);
$scriptCode = str_replace('/controls/', $http . $_SERVER['HTTP_HOST'] . '/controls/', $scriptCode);
$scriptCode = str_replace('/js/maborak/core/images/', $http . $_SERVER['HTTP_HOST'] . '/js/maborak/core/images/', $scriptCode);
//render the template
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentry.tpl';
$template = new TemplatePower($pluginTpl);
$template->prepare();
require_once 'classes/model/Step.php';
$oStep = new Step();
$sUidGrids = $oStep->lookingforUidGrids($sPRO_UID, $sDYNAFORM);
$template->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
$template->assign("URL_TRANSLATION_ENV_JS", G::browserCacheFilesUrl("/jscore/labels/" . SYS_LANG . ".js"));
$template->assign("siteUrl", $http . $_SERVER["HTTP_HOST"]);
$template->assign("sysSys", SYS_SYS);
$template->assign("sysLang", SYS_LANG);
$template->assign("sysSkin", SYS_SKIN);
$template->assign("processUid", $sPRO_UID);
$template->assign("dynaformUid", $sDYNAFORM);
$template->assign("taskUid", $sTASKS);
$template->assign("dynFileName", $sPRO_UID . "/" . $sDYNAFORM);
$template->assign("formId", $G_FORM->id);
$template->assign("scriptCode", $scriptCode);
if (sizeof($sUidGrids) > 0) {
foreach ($sUidGrids as $k => $v) {