-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to add remote poster and thumbnails to a video #19
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ protected function canonicalFieldName($name) { | |
public function postJSON() { | ||
$data = []; | ||
foreach ($this as $field => $val) { | ||
if ($field === 'changedFields' || $field === 'fieldAliases' || $val === NULL) { | ||
if ($field === 'changedFields' || $field === 'fieldAliases') { | ||
continue; | ||
} | ||
$field = $this->canonicalFieldName($field); | ||
|
@@ -84,9 +84,6 @@ public function patchJSON() { | |
$data = []; | ||
foreach ($this->changedFields as $field) { | ||
$val = $this->{$field}; | ||
if ($val === NULL) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this check removed? |
||
continue; | ||
} | ||
|
||
$field = $this->canonicalFieldName($field); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
namespace Brightcove\Object\Video; | ||
|
||
use Brightcove\Object\ObjectBase; | ||
|
||
/** | ||
* Poster image | ||
*/ | ||
class Poster extends ObjectBase { | ||
protected $id; | ||
protected $remote_url; | ||
|
||
public function applyJSON(array $json) { | ||
parent::applyJSON($json); | ||
$this->applyProperty($json, 'id'); | ||
$this->applyProperty($json, 'remote_url'); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getId() { | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* @param string $id | ||
* @return $this | ||
*/ | ||
public function setId($id) { | ||
$this->id = $id; | ||
$this->fieldChanged('id'); | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getRemoteUrl() { | ||
return $this->remote_url; | ||
} | ||
|
||
/** | ||
* @param string $remote_url | ||
* @return $this | ||
*/ | ||
public function setRemoteUrl($remote_url) { | ||
$this->remote_url = $remote_url; | ||
$this->fieldChanged('remote_url'); | ||
return $this; | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing newline. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
namespace Brightcove\Object\Video; | ||
|
||
use Brightcove\Object\ObjectBase; | ||
|
||
/** | ||
* Thumbnail image | ||
*/ | ||
class Thumbnail extends ObjectBase { | ||
protected $id; | ||
protected $remote_url; | ||
|
||
public function applyJSON(array $json) { | ||
parent::applyJSON($json); | ||
$this->applyProperty($json, 'id'); | ||
$this->applyProperty($json, 'remote_url'); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getId() { | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* @param string $id | ||
* @return $this | ||
*/ | ||
public function setId($id) { | ||
$this->id = $id; | ||
$this->fieldChanged('id'); | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getRemoteUrl() { | ||
return $this->remote_url; | ||
} | ||
|
||
/** | ||
* @param string $remote_url | ||
* @return $this | ||
*/ | ||
public function setRemoteUrl($remote_url) { | ||
$this->remote_url = $remote_url; | ||
$this->fieldChanged('remote_url'); | ||
return $this; | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing newline. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this check removed?