Файловый менеджер - Редактировать - /home/lmsyaran/public_html/libraries/regularlabs/src/ObjectHelper.php
Назад
<?php /** * @package Regular Labs Library * @version 21.2.19653 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2021 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ namespace RegularLabs\Library; defined('_JEXEC') or die; /** * Class ObjectHelper * @package RegularLabs\Library */ class ObjectHelper { /** * Return the value by the object property key * A list of keys can be given. The first one that is not empty will get returned * * @param object $object * @param string|array $keys * * @return mixed */ public static function getValue($object, $keys, $default = null) { $keys = ArrayHelper::toArray($keys); foreach ($keys as $key) { if (empty($object->{$key})) { continue; } return $object->{$key}; } return $default; } /** * Deep clone an object * * @param object $object * * @return object */ public static function deepClone($object) { return unserialize(serialize($object)); } /** * Merge 2 objects * * @param object $object1 * @param object $object2 * * @return object */ public static function merge($object1, $object2) { return (object) array_merge((array) $object1, (array) $object2); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка