/** * Apply the given predicate to all sequences of this collection, * returning true, if the predicate yields true for all sequences. * * @param Closure $p The predicate. * @return boolean TRUE, if the predicate yields TRUE for all sequences, FALSE otherwise. */ public function forAll(Closure $p) { foreach ($this->sequenceFile->getSequenceIndex() as $indexEntry => $value) { $sequence = $this->sequenceFile->readSequence($indexEntry); if (!$p($indexEntry, $sequence)) { return false; } $this->sequenceFile->putSequence($indexEntry, $sequence); } return true; }
/** * Assign sequence to the specified offset. * * @param mixed $offset * @param VIB\Bundle\BioBundle\Entity\DNA\Abstracts\Sequence $value */ public function offsetSet($offset, $value) { return $this->sequenceFile->putSequence($offset, $value); }