aboutsummaryrefslogtreecommitdiffstats
path: root/include/classes/BigPipe/Resource.php
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2016-07-10 11:24:33 +0200
committerThomas Lange <code@nerdmind.de>2016-07-10 11:24:33 +0200
commitdc0b1a382b5f980cffe87e9965e659d07107026e (patch)
treed05bd1dc5a7140caf40bb19483c93e0fe0a757f4 /include/classes/BigPipe/Resource.php
parent28f2ba2a44ca932e16ba6791a07ed42b62fe6803 (diff)
downloadbigpipe-dc0b1a382b5f980cffe87e9965e659d07107026e.tar.gz
bigpipe-dc0b1a382b5f980cffe87e9965e659d07107026e.tar.xz
bigpipe-dc0b1a382b5f980cffe87e9965e659d07107026e.zip
Each resource has now an ID; Code improvements and comment blocks added.
Diffstat (limited to 'include/classes/BigPipe/Resource.php')
-rwxr-xr-xinclude/classes/BigPipe/Resource.php37
1 files changed, 11 insertions, 26 deletions
diff --git a/include/classes/BigPipe/Resource.php b/include/classes/BigPipe/Resource.php
index d93ad16..1aaeb35 100755
--- a/include/classes/BigPipe/Resource.php
+++ b/include/classes/BigPipe/Resource.php
@@ -1,11 +1,16 @@
<?php
+#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
+# Abstract Resource representation class [Thomas Lange <tl@nerdmind.de>] #
+#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
+# #
+# [More information coming soon] #
+# #
+#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
namespace BigPipe;
-abstract class Resource {
- private $ID = '';
+abstract class Resource extends Item {
private $type = '';
private $resourceURL = '';
- private $phaseDoneJS = [];
private static $count = 0;
#===============================================================================
@@ -29,18 +34,12 @@ abstract class Resource {
#===============================================================================
# Build resource
#===============================================================================
- public function __construct($type, $resourceURL) {
- $this->phaseDoneJS = array_pad($this->phaseDoneJS, 3, []);
- $this->ID = 'R'.++self::$count;
+ public function __construct($customID = NULL, $type, $resourceURL) {
+ $this->ID = $customID ?? 'R'.++self::$count;
$this->type = $type;
$this->resourceURL = $resourceURL;
- }
- #===============================================================================
- # Return the unique ID
- #===============================================================================
- public function getID() {
- return $this->ID;
+ $this->phaseDoneJS = array_pad($this->phaseDoneJS, 3, []);
}
#===============================================================================
@@ -56,19 +55,5 @@ abstract class Resource {
public function getURL() {
return $this->resourceURL;
}
-
- #===============================================================================
- # Attach a PhaseDoneJS callback
- #===============================================================================
- public function addPhaseDoneJS($phase, $callback) {
- return $this->phaseDoneJS[$phase][] = removeLineBreaksAndTabs($callback);
- }
-
- #===============================================================================
- # Return all registered PhaseDoneJS callbacks
- #===============================================================================
- public function getPhaseDoneJS() {
- return $this->phaseDoneJS;
- }
}
?> \ No newline at end of file