IsraelOrtuno / pipedrive

Complete Pipedrive API client for PHP
MIT License
166 stars 58 forks source link

Complete? #17

Closed cesarkohl closed 7 years ago

cesarkohl commented 7 years ago

Hi, thanks for all the work you've done so far but I couldn't find a way to request /stages/:id/deals.

To overcome this need I implemented it myself (code below). Is this the only/right approach?

<?php

namespace Devio\Pipedrive\Resources;

use Devio\Pipedrive\Resources\Basics\Resource;
use Devio\Pipedrive\Resources\Traits\ListsDeals;

class Stages extends Resource
{
    use ListsDeals;

    public function deals($id, $options = [])
    {
        array_set($options, 'id', $id);

        return $this->request->get(':id/deals', $options);
    }
}
IsraelOrtuno commented 7 years ago

You do not need to include that function, the trait will do it itself :)

IsraelOrtuno commented 7 years ago
    public function deals($id, $options = [])
    {
        array_set($options, 'id', $id);

        return $this->request->get(':id/deals', $options);
    }

This is what is included in the trait use ListsDeals