PHP Class Microweber\Providers\ContentManager

Show file Open project: microweber/microweber

Public Properties

Property Type Description
$app Microweber\Application
$no_cache Boolean that indicates the usage of cache while making queries.
$precached_links
$skip_pages_starting_with_url
$table_prefix
$tables

Public Methods

Method Description
__construct ( $app = null )
attributes ( $content_id )
breadcrumb ( $params = false )
custom_fields ( $content_id, $full = true, $field_type = false )
data ( $content_id )
define_constants ( array | boolean $content = false ) Defines all constants that are needed to parse the page layout.
edit_field ( $data, $debug = false )
get ( mixed | array | boolean | string $params = false ) : array | boolean | mixed Get array of content items from the database.
get_by_id ( integer $id ) : array Get single content item by id from the content_table.
get_by_url ( $url = '', $no_recursive = false )
get_children ( $id, $without_main_parrent = false )
get_data ( $params = false )
get_inherited_parent ( $content_id ) Get the first parent that has layout.
get_page ( integer | string $id ) : array Get single content item by id from the content_table.
get_pages ( $params = false )
get_parents ( $id, $without_main_parrent = false )
get_posts ( $params = false )
get_products ( $params = false )
homepage ( ) Returns the homepage as array.
lang_current ( ) Get the current language of the site.
lang_set ( $lang = 'en' ) Set the current language.
link ( integer $id ) : string Gets a link for given content id.
next_content ( $content_id = false, $mode = 'next', $content_type = false )
pages_tree ( integer $parent, boolean $link = false, boolean $active_ids = false, boolean $active_code = false, boolean $remove_ids = false, boolean $removed_ids_code = false, boolean $ul_class_name = false, boolean $include_first = false ) : sting Print nested tree of pages.
paging ( $params ) : string paging.
paging_links ( $base_url = false, $pages_count, $paging_param = 'curent_page', $keyword_param = 'keyword' )
ping ( )
prev_content ( $content_id = false )
reorder ( $params )
save ( $data, $delete_the_cache = true )
save_content ( $data, $delete_the_cache = true )
save_content_admin ( $data, $delete_the_cache = true ) ------------------------------------------------------------------------
save_content_data_field ( $data, $delete_the_cache = true )
save_content_field ( $data, $delete_the_cache = true )
save_edit ( $post_data )
set_published ( string | array | boolean $params ) : string Set content to be published.
set_table_names ( array | boolean $tables = false ) Sets the database table names to use by the class.
set_unpublished ( string | array | boolean $params ) : string Set content to be unpublished.
site_templates ( )
title ( $id )

Method Details

__construct() public method

public __construct ( $app = null )

attributes() public method

public attributes ( $content_id )

breadcrumb() public method

public breadcrumb ( $params = false )

custom_fields() public method

public custom_fields ( $content_id, $full = true, $field_type = false )

data() public method

public data ( $content_id )

define_constants() public method

It accepts array or $content that must have $content['id'] set
public define_constants ( array | boolean $content = false )
$content array | boolean

edit_field() public method

public edit_field ( $data, $debug = false )

get() public method

It accepts string or array as parameters. You can pass any db field name as parameter to filter content by it. All parameter are passed to the get() function You can get and filter content and also order the results by criteria
public get ( mixed | array | boolean | string $params = false ) : array | boolean | mixed
$params mixed | array | boolean | string You can pass parameters as string or as array
return array | boolean | mixed Array of content or false if nothing is found

get_by_id() public method

Get single content item by id from the content_table.
public get_by_id ( integer $id ) : array
$id integer The id of the content item
return array

get_by_url() public method

public get_by_url ( $url = '', $no_recursive = false )

get_children() public method

public get_children ( $id, $without_main_parrent = false )

get_data() public method

public get_data ( $params = false )

get_inherited_parent() public method

Get the first parent that has layout.
public get_inherited_parent ( $content_id )

get_page() public method

Get single content item by id from the content_table.
public get_page ( integer | string $id ) : array
$id integer | string The id of the page or the url of a page
return array The page row from the database

get_pages() public method

public get_pages ( $params = false )

get_parents() public method

public get_parents ( $id, $without_main_parrent = false )

get_posts() public method

public get_posts ( $params = false )

get_products() public method

public get_products ( $params = false )

homepage() public method

Returns the homepage as array.
public homepage ( )

lang_current() public method

Get the current language of the site.
public lang_current ( )

lang_set() public method

Set the current language.
public lang_set ( $lang = 'en' )

next_content() public method

public next_content ( $content_id = false, $mode = 'next', $content_type = false )

pages_tree() public method

Print nested tree of pages.
public pages_tree ( integer $parent, boolean $link = false, boolean $active_ids = false, boolean $active_code = false, boolean $remove_ids = false, boolean $removed_ids_code = false, boolean $ul_class_name = false, boolean $include_first = false ) : sting
$parent integer
$link boolean
$active_ids boolean
$active_code boolean
$remove_ids boolean
$removed_ids_code boolean
$ul_class_name boolean
$include_first boolean
return sting Prints the pages tree

paging() public method

paging
Author: Microweber
public paging ( $params ) : string
$params ['num'] = 5; //the numer of pages
return string - html string with ul/li

ping() public method

public ping ( )

prev_content() public method

public prev_content ( $content_id = false )

reorder() public method

public reorder ( $params )

save() public method

public save ( $data, $delete_the_cache = true )

save_content() public method

public save_content ( $data, $delete_the_cache = true )

save_content_admin() public method

------------------------------------------------------------------------
public save_content_admin ( $data, $delete_the_cache = true )

save_content_data_field() public method

public save_content_data_field ( $data, $delete_the_cache = true )

save_content_field() public method

public save_content_field ( $data, $delete_the_cache = true )

save_edit() public method

public save_edit ( $post_data )

set_published() public method

Set is_active flag 'y'
public set_published ( string | array | boolean $params ) : string
$params string | array | boolean
return string The url of the content

set_table_names() public method

Sets the database table names to use by the class.
public set_table_names ( array | boolean $tables = false )
$tables array | boolean

set_unpublished() public method

Set is_active flag 'n'
See also: content_set_unpublished()
public set_unpublished ( string | array | boolean $params ) : string
$params string | array | boolean
return string The url of the content

site_templates() public method

public site_templates ( )

title() public method

public title ( $id )

Property Details

$app public property

public Application,Microweber $app
return Microweber\Application

$no_cache public property

Boolean that indicates the usage of cache while making queries.
public $no_cache

$skip_pages_starting_with_url public static property

public static $skip_pages_starting_with_url

$table_prefix public property

public $table_prefix

$tables public property

public $tables