| Server IP : 31.214.179.3 / Your IP : 216.73.216.84 Web Server : Apache System : Linux hostingsrv125.dondominio.com 6.12.96+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.96-1 (2026-07-20) x86_64 User : ( 1156851) PHP Version : 8.5.8 Disable Function : system,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,exec,ini_alter,show_source,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,mail,eval MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /hosting/www/thermatron.es/public/wp-content/plugins/code-snippets/php/cloud/ |
Upload File : |
<?php
namespace Code_Snippets\Cloud;
use Code_Snippets\Data_Item;
/**
* A connection between a local snippet and remote cloud snippet.
*
* @package Code_Snippets
*
* @property integer $local_id ID of local snippet as stored in WordPress database, if applicable.
* @property integer $cloud_id ID of remote snippet on cloud platform, if applicable.
* @property boolean $is_owner Ownership status of remote snippet on cloud platform.
* @property boolean $in_codevault Whether the remote snippet is stored in the users' codevault.
* @property boolean $update_available If synchronised, whether there is an update available on the cloud platform.
*/
class Cloud_Link extends Data_Item {
/**
* Constructor function
*
* @param array<string, mixed>|object $data Initial data fields.
*/
public function __construct( $data = null ) {
parent::__construct(
[
'local_id' => 0,
'cloud_id' => 0,
'is_owner' => false,
'in_codevault' => false,
'update_available' => false,
],
$data
);
}
/**
* Prepare a value before it is stored.
*
* @param mixed $value Value to prepare.
* @param string $field Field name.
*
* @return mixed Value in the correct format.
*/
protected function prepare_field( $value, string $field ) {
switch ( $field ) {
case 'local_id':
case 'remote_id':
return absint( $value );
case 'is_owner':
case 'in_codevault':
case 'update_available':
return is_bool( $value ) ? $value : (bool) $value;
default:
return $value;
}
}
}