src/wcmf/lib/persistence/AttributeDescription.php
public function matchTags(array $tags=[], $matchMode='all') {
    $numGivenTags = sizeof($tags);
    if (sizeof($numGivenTags) == 0) {
      return true;
    }
    $result = true;
    $diff = sizeof(array_diff($tags, $this->tags));
    switch ($matchMode) {
      case 'all':
        $result = ($diff == 0);
        break;
      case 'none':
        $result = ($diff == $numGivenTags);
        break;
      case 'any':
        $result = ($diff < $numGivenTags);
        break;
    }
    return $result;
  }
public function matchTags(array $tags=[], $matchMode='all') {
    $numGivenTags = sizeof($tags);
    if (sizeof($numGivenTags) == 0) {
      return true;
    }
    $result = true;
    $diff = sizeof(array_diff($tags, $this->tags));
    switch ($matchMode) {
      case 'all':
        $result = ($diff == 0);
        break;
      case 'none':
        $result = ($diff == $numGivenTags);
        break;
      case 'any':
        $result = ($diff < $numGivenTags);
        break;
    }
    return $result;
  }
public function matchTags ( array $ tags = [ ] , $ matchMode = 'all' ) { $ numGivenTags = sizeof ( $ tags ) ; if ( sizeof ( $ numGivenTags ) == 0 ) { return true ; } $ result = true ; $ diff = sizeof ( array_diff ( $ tags , $ this -> tags ) ) ; switch ( $ matchMode ) { case 'all' : $ result = ( $ diff == 0 ) ; break ; case 'none' : $ result = ( $ diff == $ numGivenTags ) ; break ; case 'any' : $ result = ( $ diff < $ numGivenTags ) ; break ; } return $ result ; }
Check if this attribute is tagged with the given application specific tags
@param $tags An array of tags that the attribute should match. Empty array results in true the given matchMode (default: empty array)
@param $matchMode One of 'all', 'none', 'any', defines how the attribute's tags should match the given tags (default: 'all')
@return True if the attribute tags satisfy the match mode, false else
Check if this attribute is tagged with the given application specific tags