projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release plat/al core v1.1.12
[platal.git]
/
classes
/
plflagset.php
diff --git
a/classes/plflagset.php
b/classes/plflagset.php
index
b5f30d9
..
baa7bf9
100644
(file)
--- a/
classes/plflagset.php
+++ b/
classes/plflagset.php
@@
-1,6
+1,6
@@
<?php
/*
<?php
/*
- * Copyright (C) 2003-201
0
Polytechnique.org
+ * Copyright (C) 2003-201
1
Polytechnique.org
* http://opensource.polytechnique.org/
*
* This program is free software; you can redistribute it and/or modify
* http://opensource.polytechnique.org/
*
* This program is free software; you can redistribute it and/or modify
@@
-21,7
+21,7
@@
/** class for describing flags
*/
/** class for describing flags
*/
-class PlFlagSet extends PlAbstractIterable implements XDBFormat
+class PlFlagSet extends PlAbstractIterable implements XDBFormat
, PlExportable
{
/** string that holds the PlFlagSet */
private $values = array();
{
/** string that holds the PlFlagSet */
private $values = array();
@@
-104,6
+104,13
@@
class PlFlagSet extends PlAbstractIterable implements XDBFormat
}
}
}
}
+ /** Remove all the flags.
+ */
+ public function clear()
+ {
+ $this->values = array();
+ }
+
/** return the PlFlagSet
*/
/** return the PlFlagSet
*/
@@
-121,6
+128,18
@@
class PlFlagSet extends PlAbstractIterable implements XDBFormat
return $flags;
}
return $flags;
}
+ /** export the PlFlagSet
+ */
+ public function export()
+ {
+ $array = array();
+ foreach ($this->values as $key=>$value) {
+ if ($value) {
+ $array[] = $key;
+ }
+ }
+ return $array;
+ }
/** format for XDB
*/
/** format for XDB
*/
@@
-134,15
+153,9
@@
class PlFlagSet extends PlAbstractIterable implements XDBFormat
*/
public function iterate()
{
*/
public function iterate()
{
- $array = array();
- foreach ($this->values as $key=>$value) {
- if ($value) {
- $array[] = $key;
- }
- }
- return PlIteratorUtils::fromArray($array, 1, true);
+ return PlIteratorUtils::fromArray($this->export(), 1, true);
}
}
}
}
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker
f
enc=utf-8:
?>
?>