• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

podio-community / podio-php / 5248053189

pending completion
5248053189

push

github

web-flow
Merge pull request #228 from podio-community/90-non-static-podio-class

feat: isolated client class to allow for parallel usage + extension mocking

648 of 648 new or added lines in 66 files covered. (100.0%)

917 of 2108 relevant lines covered (43.5%)

24.11 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/models/PodioConversation.php
1
<?php
2
/**
3
 * @see https://developers.podio.com/doc/conversations
4
 */
5
class PodioConversation extends PodioObject
6
{
7
    public function __construct(PodioClient $podio_client, $attributes = array())
8
    {
9
        parent::__construct($podio_client);
×
10
        $this->property('conversation_id', 'integer', array('id' => true));
×
11
        $this->property('subject', 'string');
×
12

13
        // Creating conversations
14
        $this->property('text', 'string');
×
15
        $this->property('participants', 'array');
×
16

17
        // Getting conversations
18
        $this->property('created_on', 'datetime');
×
19

20
        $this->has_one('ref', 'Reference');
×
21
        $this->has_one('embed', 'Embed', array('json_value' => 'embed_id', 'json_target' => 'embed_id'));
×
22
        $this->has_one('embed_file', 'File', array('json_value' => 'file_id', 'json_target' => 'embed_file_id'));
×
23
        $this->has_one('created_by', 'ByLine');
×
24
        $this->has_many('files', 'File', array('json_value' => 'file_id', 'json_target' => 'file_ids'));
×
25
        $this->has_many('messages', 'ConversationMessage');
×
26
        $this->has_many('participants_full', 'ConversationParticipant');
×
27

28
        $this->init($attributes);
×
29
    }
30

31
    /**
32
     * @see https://developers.podio.com/doc/conversations/get-conversation-22369
33
     */
34
    public static function get($conversation_id, PodioClient $podio_client)
35
    {
36
        return self::member($podio_client->get("/conversation/{$conversation_id}"), $podio_client);
×
37
    }
38

39
    /**
40
     * @see https://developers.podio.com/doc/conversations/get-conversations-34822801
41
     */
42
    public static function get_all($attributes = array(), PodioClient $podio_client)
43
    {
44
        return self::listing($podio_client->get("/conversation/", $attributes), $podio_client);
×
45
    }
46

47
    /**
48
     * @see https://developers.podio.com/doc/conversations/get-conversations-on-object-22443
49
     */
50
    public static function get_for($ref_type, $ref_id, $plugin, PodioClient $podio_client)
51
    {
52
        return self::listing($podio_client->get("/batch/{$ref_type}/{$ref_id}/"), $podio_client);
×
53
    }
54

55
    /**
56
     * @see https://developers.podio.com/doc/conversations/create-conversation-22441
57
     */
58
    public static function create($attributes = array(), PodioClient $podio_client)
59
    {
60
        return $podio_client->post("/conversation/", $attributes)->json_body();
×
61
    }
62

63
    /**
64
     * @see https://developers.podio.com/doc/conversations/create-conversation-on-object-22442
65
     */
66
    public static function create_for($ref_type, $ref_id, $attributes = array(), PodioClient $podio_client)
67
    {
68
        return $podio_client->post("/conversation/{$ref_type}/{$ref_id}/", $attributes)->json_body();
×
69
    }
70

71
    /**
72
     * @see https://developers.podio.com/doc/conversations/reply-to-conversation-22444
73
     */
74
    public static function create_reply($conversation_id, $attributes = array(), PodioClient $podio_client)
75
    {
76
        $body = $podio_client->post("/conversation/{$conversation_id}/reply", $attributes)->json_body();
×
77
        return $body['message_id'];
×
78
    }
79

80
    /**
81
     * @see https://developers.podio.com/doc/conversations/add-participants-384261
82
     */
83
    public static function add_participant($conversation_id, $attributes = array(), PodioClient $podio_client)
84
    {
85
        return $podio_client->post("/conversation/{$conversation_id}/participant/", $attributes)->json_body();
×
86
    }
87
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc