Shadow-Here


Server : Apache
System : Linux methusalix2 3.16.0-11-amd64 #1 SMP Debian 3.16.84-1 (2020-06-09) x86_64
User : hios ( 1437)
PHP Version : 5.6.40-0+deb8u12
Disable Function : proc_close,proc_open,dl,shell_exec,passthru
Directory :  /home/dreiseitel/yin/core/model/modx/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :
Current File : /home/dreiseitel/yin/core/model/modx/modlexiconentry.class.php
<?php
/*
 * This file is part of MODX Revolution.
 *
 * Copyright (c) MODX, LLC. All Rights Reserved.
 *
 * For complete copyright and license information, see the COPYRIGHT and LICENSE
 * files found in the top-level directory of this distribution.
 */

/**
 * Database abstraction of a Lexicon Entry. Used only for overrides on existing entries as a way of allowing
 * customization without sacrificing upgradability of file-based lexicon topics.
 *
 * @property string $name The name, or key, of the lexicon entry that is being overridden
 * @property string $value The value to override the entry with
 * @property string $topic The topic of the overridden entry
 * @property string $namespace The namespace of the overridden entry
 * @property string $language The language of the overridden entry
 * @property datetime $createdon The time that this entry was created
 * @property string $editedon The last time that this entry was edited
 * @see modLexicon
 * @package modx
 */
class modLexiconEntry extends xPDOSimpleObject {
    /**
     * Clears the cache for the entry
     *
     * @access public
     * @return boolean True if successful
     */
    public function clearCache() {
        if ($this->xpdo && $this->xpdo->lexicon) {
            return $this->xpdo->lexicon->clearCache($this->get('language').'/'.$this->get('namespace').'/'.$this->get('topic').'.cache.php');
        }
        return false;
    }

    /**
     * Overrides xPDOObject::save to clear lexicon cache on saving.
     *
     * {@inheritdoc}
     */
    public function save($cacheFlag= null) {
        if ($this->_new) {
            if (!$this->get('createdon')) $this->set('createdon', strftime('%Y-%m-%d %H:%M:%S'));
        }
        $saved= parent :: save($cacheFlag);
        if ($saved && empty($this->xpdo->config[xPDO::OPT_SETUP])) {
            $this->clearCache();
        }
        return $saved;
    }
}

Samx