public static function app() { if (self::$instance == null) { self::$instance = new self(); } return self::$instance; }
function _init() { self::$relationships = array('user' => ORM::belongs_to('\\Model\\Blog'), 'route' => ORM::belongs_to('\\Model\\Route'), 'media' => ORM::has_many('\\Model\\Post\\Media => \\Model\\Media')); self::$fields = array('id' => ORM::field('auto[11]'), 'title' => ORM::field('char[3,155]', array('required', 'max_length[155]')), 'summary' => ORM::field('string', array(), 'LONGTEXT'), 'content_raw' => ORM::field('string', array(), 'LONGTEXT'), 'content' => ORM::field('string', array(), 'LONGTEXT'), 'modified' => ORM::field('datetime'), 'created' => ORM::field('datetime')); $this->ts_fields = array('modified', '[created]'); }
function check_document_count($url) { require_once "lib" . DIRECTORY_SEPARATOR . "ModelPost.php"; $model_post = new ModelPost(); $model_post->documentIndex = get_option('elasticsearch_settings_index_name'); $model_post->serverUrl = $url; return $model_post->checkIndexCount(); }