HEX
Server: Apache/2.4.25
System: Linux ion14 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64
User: (10087)
PHP: 7.4.30
Disabled: 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,system, exec, shell_exec, passthru, popen, proc_open
Upload Files
File: /home/www/web115/wordpress/wp-content/plugins/digimember/application/model/data/shortcodes.php
<?php

class digimember_ShortcodesData extends ncore_BaseData
{
    const ADVANCED_FORM_ELEMENT_ID_LENGTH = 15;

    public function dataType()
    {
        return NCORE_MODEL_DATA_TYPE_ADVANCED_FORM_ELEMENT;
    }

    public function options( $where=array())
    {
        return $this->asArray( 'title', 'id', $where );
    }

    protected function sqlBaseTableName()
    {
        return 'shortcodes';
    }

    protected function serializedColumns()
    {
        return array();
    }

    protected function onBeforeCopy( &$data )
    {
        parent::onBeforeSave( $data );
    }


    protected function onBeforeSave( &$data )
    {
        parent::onBeforeSave( $data );
    }

    protected function sqlTableMeta()
    {
       $columns = array(
           'shortcode'        => 'string[255]',
           'description'      => 'string[255]',
       );
       $indexes = array( /*'order_id', 'product_id', 'email'*/ );
       $meta = array(
        'columns' => $columns,
        'indexes' => $indexes,
       );
       return $meta;
    }

    protected function buildObject( $obj )
    {
        parent::buildObject( $obj );
    }


    protected function hasTrash()
    {
        return false;
    }

    protected function defaultValues()
    {
        $values = parent::defaultValues();
        return $values;
    }

    protected function hasModified()
    {
        return false;
    }


    /**
     * createTableIfNeeded
     * creates table of the model when called and the table doesnt exist.
     * @return bool
     */
    public function createTableIfNeeded() {
        global $wpdb;
        $table_name = $this->sqlTableName();
        $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) );
        if ( ! $wpdb->get_var( $query ) == $table_name ) {
            $initCore = $this->api->init();
            $initCore->forceUpgrade();
            return true;
        }
        return false;
    }
}