public function testSet_distid() { $update1 = $this->object->get_updated_on(); sleep(1); $this->object->set_dist_id($this->dist_id); $this->assertEquals($this->dist_id, $this->object->get_dist_id()); $update2 = $this->object->get_updated_on(); $this->assertTrue($update2 > $update1); }
/** * * @param Bridge_Element $element * * @return Array */ public function get_element_status(Bridge_Element $element) { $url = sprintf("/%s/%s", $element->get_type(), $element->get_dist_id()); $result = $this->_api->call($url, ['fields' => ['status']], $this->oauth_token); return $result["status"]; }
/** * * @param Bridge_Element $element * * @return string */ public function get_element_status(Bridge_Element $element) { $this->_api->setMajorProtocolVersion(1); $state = $this->_api->getFullVideoEntry($element->get_dist_id())->getVideoState(); if (is_null($state)) { $result = Bridge_Element::STATUS_DONE; } else { $result = $state->getName(); } $this->_api->setMajorProtocolVersion(2); return $result; }
public function get_element_status(Bridge_Element $element) { try { $ticket = $this->checkTicket($element->get_dist_id(), $element->get_type()); if ($ticket["status"] == self::UPLOAD_STATE_DONE) { $this->get_element_from_id($ticket["dist_id"], $element->get_type()); $element->set_dist_id($ticket["dist_id"]); } } catch (\Exception $e) { return self::UPLOAD_STATE_FAILED; } return $ticket["status"]; }