|
Server : LiteSpeed System : Linux quebec.us.hostns.io 5.14.0-687.42.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 27 11:55:12 EDT 2026 x86_64 User : gazetufm ( 1431) PHP Version : 8.1.35 Disable Function : NONE Directory : /home2/gazetufm/leonora.al/wp-content/plugins/kirki/app/Casts/ | |
|
Path: //home2/gazetufm/leonora.al/wp-content/plugins/kirki/app/Casts/AsSerialize.php
Size: 810 B
Permissions: 0644
<?php
namespace Kirki\App\Casts;
use Kirki\Framework\Database\Contracts\CastsAttributes;
use Kirki\Framework\Database\Query\Model;
defined('ABSPATH') || exit;
class AsSerialize implements CastsAttributes
{
/**
* Cast the given value.
*
* @param array<string, mixed> $attributes
*
* @return mixed
*/
public function get(Model $model, string $key, $value, array $attributes)
{
return $value !== '' ? maybe_unserialize($value) : null;
}
/**
* Prepare the given value for storage.
*
* @param array<string, mixed> $attributes
*
* @return string
*/
public function set(Model $model, string $key, $value, array $attributes)
{
return $value ? maybe_serialize($value) : '';
}
}