X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fplflagset.php;h=c6c8d41f93b123407edf5a4545f95c60c2c6d9fc;hb=ac6f41acd95a154ff0893f5e239760e026eb9d2a;hp=b5f30d93cfc350fbb9ad59d4eccd5f43b044f9d2;hpb=988a0ceddebb96949ca74e62129d9b3dbe2450c3;p=platal.git diff --git a/classes/plflagset.php b/classes/plflagset.php index b5f30d9..c6c8d41 100644 --- a/classes/plflagset.php +++ b/classes/plflagset.php @@ -1,6 +1,6 @@ values = array(); + } + /** return the PlFlagSet */ @@ -121,6 +128,18 @@ class PlFlagSet extends PlAbstractIterable implements XDBFormat 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 */ @@ -134,13 +153,7 @@ class PlFlagSet extends PlAbstractIterable implements XDBFormat */ 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); } }