public function testTypedSequence()
 {
     $object1 = new \ArrayObject([1, 2, 3]);
     $object2 = new \ArrayObject([3, 2, 1]);
     $sequence = new TypedSequence('\\ArrayObject', [$object1]);
     $this->assertSame([$object1], $sequence->all());
     $sequence->add($object2);
     $this->assertSame([$object1, $object2], $sequence->all());
     $sequence->update(0, $object2)->update(1, $object1);
     $this->assertSame([$object2, $object1], $sequence->all());
     $sequence = new TypedSequence('\\ArrayObject');
     $sequence->addAll([$object1, $object2]);
     $this->assertSame([$object1, $object2], $sequence->all());
     $sequence->removeElement($object2);
     $this->assertSame([$object1], $sequence->all());
 }
Example #2
0
 /**
  * Add a match
  *
  * @param  ValueAttrib $match
  * @return self
  */
 public function addMatch(ValueAttrib $match)
 {
     $this->_matches->add($match);
     return $this;
 }
 /**
  * Add a condition
  *
  * @param  SearchFilterCondition $condition
  * @return self
  */
 public function addCondition(SearchFilterCondition $condition)
 {
     $this->_conditions->add($condition);
     return $this;
 }
 /**
  * Add a right
  *
  * @param  Right $right
  * @return self
  */
 public function addRight(Right $right)
 {
     $this->_rights->add($right);
     return $this;
 }
Example #5
0
 /**
  * Add a field
  *
  * @param  QueueQueryField $field
  * @return self
  */
 public function addField(QueueQueryField $field)
 {
     $this->_fields->add($field);
     return $this;
 }
Example #6
0
 /**
  * Add a xprop
  *
  * @param  XProp $xprop
  * @return self
  */
 public function addXProp(XProp $xprop)
 {
     $this->_xprops->add($xprop);
     return $this;
 }
 /**
  * Get string of change
  *
  * @return string
  */
 public function getChanges()
 {
     return count($this->_changes) ? implode(',', $this->_changes->all()) : NULL;
 }
Example #8
0
 /**
  * Add XNameRule
  *
  * @param  XNameRule $ruleXName
  * @return self
  */
 public function addXNameRule(XNameRule $ruleXName)
 {
     $this->_ruleXNames->add($ruleXName);
     return $this;
 }
Example #9
0
 /**
  * Add a mime part info
  *
  * @param  MimePartInfo $mp
  * @return self
  */
 public function addMimePart(MimePartInfo $mp)
 {
     $this->_mimeParts->add($mp);
     return $this;
 }
Example #10
0
 /**
  * Add xparam
  *
  * @param  WkDay $xparam
  * @return self
  */
 public function addWkDay(WkDay $wkday)
 {
     $this->_wkday->add($wkday);
     return $this;
 }
Example #11
0
 /**
  * Add an ace
  *
  * @param  ACE $aces
  * @return self
  */
 public function addAce(ACE $aces)
 {
     $this->_aces->add($aces);
     return $this;
 }
Example #12
0
 /**
  * Add a stat
  *
  * @param  NamedElement $stat
  * @return self
  */
 public function addStat(NamedElement $stat)
 {
     $this->_stats->add($stat);
     return $this;
 }
Example #13
0
 /**
  * Add any
  *
  * @param  Base $any
  * @return self
  */
 public function addAny(Base $any)
 {
     $this->_any->add($tz);
     return $this;
 }
 /**
  * Get string of change
  *
  * @return string
  */
 public function changes()
 {
     return count($this->_changes) ? implode(',', $this->_changes->all()) : '';
 }
 /**
  * Add an item
  *
  * @param  ItemSpec $item
  * @return self
  */
 public function addItem(ItemSpec $item)
 {
     $this->_items->add($item);
     return $this;
 }
Example #16
0
 /**
  * Add extra element
  *
  * @param  Base $extra
  * @return self
  */
 public function addExtra(Base $extra)
 {
     $this->_extras->add($extra);
     return $this;
 }