public function getAssetID($name)
    {
        $list = $this->getAssetList();

        $list_json = json_decode($list, true);

        foreach ($list_json as $asset)
        {
            if ($asset['name'] == $name)
            {
                return $asset['id'];
            }
        }
        throw new \Exception('No asset found by name');
    }
public function getAssetID($name)
    {
        $list = $this->getAssetList();

        $list_json = json_decode($list, true);

        foreach ($list_json as $asset)
        {
            if ($asset['name'] == $name)
            {
                return $asset['id'];
            }
        }
        throw new \Exception('No asset found by name');
    }
public function getAssetID ( $ name ) { $ list = $ this -> getAssetList ( ) ; $ list_json = json_decode ( $ list , true ) ; foreach ( $ list_json as $ asset ) { if ( $ asset [ 'name' ] == $ name ) { return $ asset [ 'id' ] ; } } throw new \ Exception ( 'No asset found by name' ) ; }
Gets the asset ID by the name

@param string $name  Name of the asset
@return string $id   ID of the asset
@throws \Exception
Gets the asset ID by the name