public function find($terms /* associate array of terms */, $absolute=TRUE)
    {
      $terms = Ensure::Input($terms);

      $terms = $terms->get();
      $out = array();
      /** when absolute is on, all terms should match **/
      foreach ($this->data as $d) {
        $m = 0;

        foreach ($terms as $k => $term) {
           if ($absolute) {
            if (is_object($d)) 
              if ($d->$k === $term)
                $m++;

            if (is_array($d)) 
              if ($d[$k] === $term)
                $m++;

            if (sizeof($terms) == $m) 
              $out[] = $d;

          } else {
            /** add if any terms match **/
            if (is_object($d)) 
              if ($d->$k === $term)
                $out[] = $d;

            if (is_array($d)) 
              if ($d[$k] === $term)
                $out[] = $d;
          }

        }
      }

      /** update adds direct object updating **/
      $this->data = $out;

      return new CollectionSequence($out, $this->getName());
    }
public function find($terms /* associate array of terms */, $absolute=TRUE)
    {
      $terms = Ensure::Input($terms);

      $terms = $terms->get();
      $out = array();
      /** when absolute is on, all terms should match **/
      foreach ($this->data as $d) {
        $m = 0;

        foreach ($terms as $k => $term) {
           if ($absolute) {
            if (is_object($d)) 
              if ($d->$k === $term)
                $m++;

            if (is_array($d)) 
              if ($d[$k] === $term)
                $m++;

            if (sizeof($terms) == $m) 
              $out[] = $d;

          } else {
            /** add if any terms match **/
            if (is_object($d)) 
              if ($d->$k === $term)
                $out[] = $d;

            if (is_array($d)) 
              if ($d[$k] === $term)
                $out[] = $d;
          }

        }
      }

      /** update adds direct object updating **/
      $this->data = $out;

      return new CollectionSequence($out, $this->getName());
    }
public function find ( $ terms /* associate array of terms */ , $ absolute = TRUE ) { $ terms = Ensure :: Input ( $ terms ) ; $ terms = $ terms -> get ( ) ; $ out = array ( ) ; /** when absolute is on, all terms should match **/ foreach ( $ this -> data as $ d ) { $ m = 0 ; foreach ( $ terms as $ k => $ term ) { if ( $ absolute ) { if ( is_object ( $ d ) ) if ( $ d -> $ k === $ term ) $ m ++ ; if ( is_array ( $ d ) ) if ( $ d [ $ k ] === $ term ) $ m ++ ; if ( sizeof ( $ terms ) == $ m ) $ out [ ] = $ d ; } else { /** add if any terms match **/ if ( is_object ( $ d ) ) if ( $ d -> $ k === $ term ) $ out [ ] = $ d ; if ( is_array ( $ d ) ) if ( $ d [ $ k ] === $ term ) $ out [ ] = $ d ; } } } /** update adds direct object updating **/ $ this -> data = $ out ; return new CollectionSequence ( $ out , $ this -> getName ( ) ) ; }
get a specific entity
in the collection

@param id -> id for match
@return collectionsequence
get a specific entity in the collection