public function getAvatars(array $accounts)
    {
        $ids = [];
        foreach ($accounts as $account) {
            if ($account instanceof Account) {
                $ids[] = $account->getId();
            } else {
                $ids[] = $account;
            }
        }

        $response = $this->client->sendRequest(
            $this->getBase() . '/Avatar',
            'POST',
            $ids
        );
        if (!is_array($response)) {
            throw new UnexpectedValueException('Array expected, but got ' . gettype($response));
        }

        $result = [];
        /** @var array $response */
        foreach ($response as $item) {
            try {
                $result[] = new FileStruct($item);
            } catch (\InvalidArgumentException $e) {
                throw new UnexpectedValueException($e->getMessage(), $e->getCode(), $e);
            }
        }

        return $result;
    }
public function getAvatars(array $accounts)
    {
        $ids = [];
        foreach ($accounts as $account) {
            if ($account instanceof Account) {
                $ids[] = $account->getId();
            } else {
                $ids[] = $account;
            }
        }

        $response = $this->client->sendRequest(
            $this->getBase() . '/Avatar',
            'POST',
            $ids
        );
        if (!is_array($response)) {
            throw new UnexpectedValueException('Array expected, but got ' . gettype($response));
        }

        $result = [];
        /** @var array $response */
        foreach ($response as $item) {
            try {
                $result[] = new FileStruct($item);
            } catch (\InvalidArgumentException $e) {
                throw new UnexpectedValueException($e->getMessage(), $e->getCode(), $e);
            }
        }

        return $result;
    }
public function getAvatars ( array $ accounts ) { $ ids = [ ] ; foreach ( $ accounts as $ account ) { if ( $ account instanceof Account ) { $ ids [ ] = $ account -> getId ( ) ; } else { $ ids [ ] = $ account ; } } $ response = $ this -> client -> sendRequest ( $ this -> getBase ( ) . '/Avatar' , 'POST' , $ ids ) ; if ( ! is_array ( $ response ) ) { throw new UnexpectedValueException ( 'Array expected, but got ' . gettype ( $ response ) ) ; } $ result = [ ] ; /** @var array $response */ foreach ( $ response as $ item ) { try { $ result [ ] = new FileStruct ( $ item ) ; } catch ( \ InvalidArgumentException $ e ) { throw new UnexpectedValueException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } } return $ result ; }
Get avatars.

@param array $accounts Array of {@see \Comindware\Tracker\API\Model\Account} or IDs.

@return FileStruct[]

@throws \Comindware\Tracker\API\Exception\RuntimeException In case of non-API errors.
@throws \Comindware\Tracker\API\Exception\UnexpectedValueException On invalid response.
@throws \Comindware\Tracker\API\Exception\WebApiClientException Ore one of descendants.
@throws \LogicException On internal errors.

@since 0.1
Get avatars .