HOR-3670-RG-2 Files review:
workflow/engine/classes/LdapAdvanced.php workflow/engine/classes/License_Application.php workflow/engine/classes/MultipleFilesBackup.php workflow/engine/classes/NET.php workflow/engine/classes/ObjectCellection.php
This commit is contained in:
67
workflow/engine/classes/ObjectCollection.php
Normal file
67
workflow/engine/classes/ObjectCollection.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* ObjectDocument Collection
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/
|
||||
class ObjectCollection
|
||||
{
|
||||
public $num;
|
||||
public $swapc;
|
||||
public $objects;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->objects = array();
|
||||
$this->num = 0;
|
||||
$this->swapc = $this->num;
|
||||
array_push($this->objects, 'void');
|
||||
}
|
||||
|
||||
/**
|
||||
* add in the collecetion a new object Document
|
||||
*
|
||||
* @param $name name object document
|
||||
* @param $type type object document
|
||||
* @param $data data object document
|
||||
* @param $origin origin object document
|
||||
* @return void
|
||||
*/
|
||||
public function add($name, $type, $data, $origin)
|
||||
{
|
||||
$o = new ObjectDocument();
|
||||
$o->name = $name;
|
||||
$o->type = $type;
|
||||
$o->data = $data;
|
||||
$o->origin = $origin;
|
||||
|
||||
$this->num++;
|
||||
array_push($this->objects, $o);
|
||||
$this->swapc = $this->num;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the collection of ObjectDocument
|
||||
*
|
||||
* @param $name name object document
|
||||
* @param $type type object document
|
||||
* @param $data data object document
|
||||
* @param $origin origin object document
|
||||
* @return void
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
if ($this->swapc > 0) {
|
||||
$e = $this->objects[$this->swapc];
|
||||
$this->swapc--;
|
||||
return $e;
|
||||
} else {
|
||||
$this->swapc = $this->num;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user