src/Keboola/Writer/GoodData/Client.php
public function createProject($writerId, $name = null, $accessToken = null, $queue = 'primary')
    {
        $job = $this->createProjectAsync($writerId, $name, $accessToken, $queue);
        if (!isset($job['url'])) {
            throw new ServerException('Create project job returned unexpected result: ' . json_encode($job, JSON_PRETTY_PRINT));
        }

        $result = $this->waitForJob($job['url']);
        if (!isset($result['result'][0]['pid'])) {
            throw new ServerException('Job info for create project returned unexpected result: ' . json_encode($result, JSON_PRETTY_PRINT));
        }

        return ['pid' => $result['result'][0]['pid']];
    }
public function createProject($writerId, $name = null, $accessToken = null, $queue = 'primary')
    {
        $job = $this->createProjectAsync($writerId, $name, $accessToken, $queue);
        if (!isset($job['url'])) {
            throw new ServerException('Create project job returned unexpected result: ' . json_encode($job, JSON_PRETTY_PRINT));
        }

        $result = $this->waitForJob($job['url']);
        if (!isset($result['result'][0]['pid'])) {
            throw new ServerException('Job info for create project returned unexpected result: ' . json_encode($result, JSON_PRETTY_PRINT));
        }

        return ['pid' => $result['result'][0]['pid']];
    }
public function createProject ( $ writerId , $ name = null , $ accessToken = null , $ queue = 'primary' ) { $ job = $ this -> createProjectAsync ( $ writerId , $ name , $ accessToken , $ queue ) ; if ( ! isset ( $ job [ 'url' ] ) ) { throw new ServerException ( 'Create project job returned unexpected result: ' . json_encode ( $ job , JSON_PRETTY_PRINT ) ) ; } $ result = $ this -> waitForJob ( $ job [ 'url' ] ) ; if ( ! isset ( $ result [ 'result' ] [ 0 ] [ 'pid' ] ) ) { throw new ServerException ( 'Job info for create project returned unexpected result: ' . json_encode ( $ result , JSON_PRETTY_PRINT ) ) ; } return [ 'pid' => $ result [ 'result' ] [ 0 ] [ 'pid' ] ] ; }
Create project and wait for finish, return project's pid
@param $writerId
@param $name
@param $accessToken
@param string $queue primary|secondary
@throws ServerException
@return array
Create project and wait for finish return project s pid