lib/serverdensity/Api/Tags.php
public function findAll(array $names)
    {
        $tags = $this->all();
        $transformTags = function($array) {
                $newArray = array();
                foreach($array as $entry){
                    $newArray[$entry['name']] = $entry;
                }
                return $newArray;
            };
        $tagNames = $transformTags($tags);
        $found = array(
            'tags' => array(),
            'notFound' => array()
        );
        foreach ($names as $name){
            if (in_array($name, array_keys($tagNames))){
                $found['tags'][] = $tagNames[$name];
            } else {
                $found['notFound'][] = $name;
            }
        }
        return $found;
    }
public function findAll(array $names)
    {
        $tags = $this->all();
        $transformTags = function($array) {
                $newArray = array();
                foreach($array as $entry){
                    $newArray[$entry['name']] = $entry;
                }
                return $newArray;
            };
        $tagNames = $transformTags($tags);
        $found = array(
            'tags' => array(),
            'notFound' => array()
        );
        foreach ($names as $name){
            if (in_array($name, array_keys($tagNames))){
                $found['tags'][] = $tagNames[$name];
            } else {
                $found['notFound'][] = $name;
            }
        }
        return $found;
    }
public function findAll ( array $ names ) { $ tags = $ this -> all ( ) ; $ transformTags = function ( $ array ) { $ newArray = array ( ) ; foreach ( $ array as $ entry ) { $ newArray [ $ entry [ 'name' ] ] = $ entry ; } return $ newArray ; } ; $ tagNames = $ transformTags ( $ tags ) ; $ found = array ( 'tags' => array ( ) , 'notFound' => array ( ) ) ; foreach ( $ names as $ name ) { if ( in_array ( $ name , array_keys ( $ tagNames ) ) ) { $ found [ 'tags' ] [ ] = $ tagNames [ $ name ] ; } else { $ found [ 'notFound' ] [ ] = $ name ; } } return $ found ; }
Find all tags by name
@param    array   names   tag names in an array
@return   an array of array objects.
Find all tags by name