wordpress-event-bridge-for-.../includes/activitypub/transmogrifier/class-the-events-calendar-event-repository.php
André Menrath e12a0734a5
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Successful in 47s
PHPUnit / PHPUnit – PHP 7.4 (pull_request) Failing after 56s
PHPUnit / PHPUnit – PHP 8.0 (pull_request) Failing after 1m0s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 1m0s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 59s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 57s
PHPUnit / PHPUnit – PHP 8.4 (pull_request) Failing after 1m0s
some progress on The Events Calendar Transmogrifier
2024-12-16 00:58:47 +01:00

47 lines
1 KiB
PHP

<?php
/**
* Extending the Tribe Events API to allow setting of the guid.
*
* @package Event_Bridge_For_ActivityPub
* @since 1.0.0
* @license AGPL-3.0-or-later
*/
namespace Event_Bridge_For_ActivityPub\Activitypub\Transmogrifier;
use DateTime;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
/**
* Extending the Tribe Events API to allow setting of the guid.
*
* @since 1.0.0
*/
class The_Events_Calendar_Event_Repository extends \Tribe__Events__Repositories__Event {
/**
* Override diff: allow setting of guid.
*
* @var array An array of keys that cannot be updated on this repository.
*/
protected static $blocked_keys = array(
'ID',
'post_type',
'post_modified',
'post_modified_gmt',
'comment_count',
);
/**
* Whether the current key can be updated by this repository or not.
*
* @since 4.7.19
*
* @param string $key The key.
* @return bool
*/
protected function can_be_updated( $key ) {
return ! in_array( $key, self::$blocked_keys, true );
}
}