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

podio-community / podio-php / 5913140543

pending completion
5913140543

Pull #242

github

web-flow
Merge 3f09d5988 into 51d68f28d
Pull Request #242: More fixes

181 of 181 new or added lines in 43 files covered. (100.0%)

1149 of 2094 relevant lines covered (54.87%)

8.61 hits per line

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

63.64
/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($attributes = array())
8
    {
9
        parent::__construct();
1✔
10
        $this->property('conversation_id', 'integer', array('id' => true));
1✔
11
        $this->property('subject', 'string');
1✔
12

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

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

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

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

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

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

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

55
    /**
56
     * @see https://developers.podio.com/doc/conversations/create-conversation-22441
57
     */
58
    public static function create(PodioClient $podio_client, $attributes = array())
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(PodioClient $podio_client, $ref_type, $ref_id, $attributes = array())
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(PodioClient $podio_client, $conversation_id, $attributes = array())
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(PodioClient $podio_client, $conversation_id, $attributes = array())
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