-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13127 from kaltura/moderation-catalog-item
Add moderation catalog item
- Loading branch information
Showing
15 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
plugins/reach/lib/api/data/entryVendorTaks/KalturaModerationVendorTaskData.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
/** | ||
* @package plugins.reach | ||
* @subpackage api.objects | ||
* @relatedService EntryVendorTaskService | ||
*/ | ||
class KalturaModerationVendorTaskData extends KalturaVendorTaskData | ||
{ | ||
/** | ||
* A comma seperated string of rule IDs. | ||
* | ||
* @var string | ||
*/ | ||
public $ruleIds; | ||
|
||
/** | ||
* A comma seperated string of policy IDs. | ||
* | ||
* @var string | ||
*/ | ||
public $policyIds; | ||
|
||
/** | ||
* JSON string containing the moderation output. | ||
* | ||
* @var string | ||
*/ | ||
public $moderationOutputJson; | ||
|
||
|
||
private static $map_between_objects = array | ||
( | ||
'ruleIds', | ||
'policyIds', | ||
'moderationOutputJson' | ||
); | ||
|
||
public function getMapBetweenObjects() | ||
{ | ||
return array_merge(parent::getMapBetweenObjects(), self::$map_between_objects); | ||
} | ||
|
||
public function toObject($dbObject = null, $propsToSkip = array()) | ||
{ | ||
if (!$dbObject) | ||
{ | ||
$dbObject = new kModerationVendorTaskData(); | ||
} | ||
|
||
return parent::toObject($dbObject, $propsToSkip); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
plugins/reach/lib/api/data/vendorCatalogItem/KalturaVendorModerationCatalogItem.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* @package plugins.reach | ||
* @subpackage api.objects | ||
*/ | ||
class KalturaVendorModerationCatalogItem extends KalturaVendorCatalogItem | ||
{ | ||
protected function getServiceFeature(): int | ||
{ | ||
return VendorServiceFeature::MODERATION; | ||
} | ||
|
||
public function toInsertableObject($object_to_fill = null, $props_to_skip = array()) | ||
{ | ||
if (is_null($object_to_fill)) | ||
{ | ||
$object_to_fill = new VendorModerationCatalogItem(); | ||
} | ||
|
||
return parent::toInsertableObject($object_to_fill, $props_to_skip); | ||
} | ||
|
||
public function toObject($object_to_fill = null, $props_to_skip = array()) | ||
{ | ||
if(is_null($object_to_fill)) | ||
{ | ||
$object_to_fill = new VendorModerationCatalogItem(); | ||
} | ||
|
||
return parent::toObject($object_to_fill, $props_to_skip); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...reach/lib/api/data/vendorCatalogItem/filters/KalturaVendorModerationCatalogItemFilter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
/** | ||
* @package plugins.reach | ||
* @subpackage api.filters | ||
*/ | ||
class KalturaVendorModerationCatalogItemFilter extends KalturaVendorCatalogItemFilter | ||
{ | ||
public function getTypeListResponse(KalturaFilterPager $pager, KalturaDetachedResponseProfile $responseProfile = null, $type = null) | ||
{ | ||
if (!$type) | ||
{ | ||
$type = KalturaVendorServiceFeature::MODERATION; | ||
} | ||
|
||
return parent::getTypeListResponse($pager, $responseProfile, $type); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
plugins/reach/lib/model/data/VendorModerationCatalogItem.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
/** | ||
* @package plugins.reach | ||
* @subpackage model | ||
*/ | ||
class VendorModerationCatalogItem extends VendorCatalogItem | ||
{ | ||
public function applyDefaultValues(): void | ||
{ | ||
$this->setServiceFeature(VendorServiceFeature::MODERATION); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
plugins/reach/lib/model/data/kModerationVendorTaskData.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
/** | ||
* @package plugins.reach | ||
* @subpackage model | ||
*/ | ||
class kModerationVendorTaskData extends kVendorTaskData | ||
{ | ||
protected string $ruleIds = ""; | ||
protected string $policyIds = ""; | ||
protected string $moderationOutputJson = ""; | ||
|
||
public function getRuleIds(): string | ||
{ | ||
return $this->ruleIds; | ||
} | ||
|
||
public function setRuleIds(string $ruleIds): void | ||
{ | ||
$this->ruleIds = $ruleIds; | ||
} | ||
|
||
public function getPolicyIds(): string | ||
{ | ||
return $this->policyIds; | ||
} | ||
|
||
public function setPolicyIds(string $policyIds): void | ||
{ | ||
$this->policyIds = $policyIds; | ||
} | ||
|
||
public function getModerationOutputJson(): string | ||
{ | ||
return $this->moderationOutputJson; | ||
} | ||
|
||
public function setModerationOutputJson(string $moderationOutputJson): void | ||
{ | ||
$this->moderationOutputJson = $moderationOutputJson; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters