Commit e8f21af1 authored by Keven's avatar Keven
Browse files

Allow to use a Publication Channel instance in UsageCollection::addUsage(..)

parent c25b16c1
......@@ -29,6 +29,10 @@ class UsageCollection implements \IteratorAggregate
*/
public function addUsage(Usage $usage, $channel)
{
if ($channel instanceof \Libcast\Client\Model\PublicationInterface) {
$channel = $channel->href;
}
foreach ($this->usages as $key => $values) {
if ($key == $channel) {
foreach ($values as $value) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment