PHP Class GP_Project, GlotPress-WP

Inheritance: extends GP_Thing
Show file Open project: GlotPress/GlotPress-WP Class Usage Examples

Public Properties

Property Type Description
$active
$description
$field_names
$id
$int_fields
$name
$non_updatable_attributes
$parent_project_id
$path
$slug
$source_url_template
$table_basename
$user_source_url_template

Public Methods

Method Description
_compare_set_item ( $set, $this_set )
after_create ( ) : boolean Executes after creating a project.
after_delete ( ) : boolean Executes after deleting a project.
after_save ( ) : boolean Executes after saving a project.
by_path ( $path ) Additional queries
copy_originals_from ( $source_project_id )
copy_sets_and_translations_from ( $source_project_id )
delete ( ) : boolean Deletes a project and all of sub projects, translations, translation sets, originals and glossaries.
duplicate_project_contents_from ( $source_project )
inclusive_sub_projects ( ) : array Gives an array of project objects starting from the current project children then its grand children etc
normalize_fields ( array $args ) : array Normalizes an array with key-value pairs representing a GP_Project object.
path_to_root ( ) : array Gives an array of project objects starting from the current project then its parent, its parent and up to the root
regenerate_paths ( $parent_project_id = null ) Regenrate the paths of all projects from its parents slugs
restrict_fields ( GP_Validation_Rules $rules ) Sets restriction rules for fields.
set_difference_from ( $other_project )
source_url ( $file, $line )
source_url_template ( )
sub_projects ( )
top_level ( )
update_path ( ) Updates this project's and its chidlren's paths, according to its current slug.

Method Details

_compare_set_item() public method

public _compare_set_item ( $set, $this_set )

after_create() public method

Executes after creating a project.
Since: 1.0.0
public after_create ( ) : boolean
return boolean

after_delete() public method

Executes after deleting a project.
Since: 2.0.0
public after_delete ( ) : boolean
return boolean

after_save() public method

Executes after saving a project.
Since: 1.0.0
public after_save ( ) : boolean
return boolean

by_path() public method

Additional queries
public by_path ( $path )

copy_originals_from() public method

public copy_originals_from ( $source_project_id )

copy_sets_and_translations_from() public method

public copy_sets_and_translations_from ( $source_project_id )

delete() public method

Deletes a project and all of sub projects, translations, translation sets, originals and glossaries.
Since: 2.0.0
public delete ( ) : boolean
return boolean

duplicate_project_contents_from() public method

public duplicate_project_contents_from ( $source_project )

inclusive_sub_projects() public method

Gives an array of project objects starting from the current project children then its grand children etc
public inclusive_sub_projects ( ) : array
return array

normalize_fields() public method

Normalizes an array with key-value pairs representing a GP_Project object.
Since: 1.0.0
public normalize_fields ( array $args ) : array
$args array Arguments for a GP_Project object.
return array Normalized arguments for a GP_Project object.

path_to_root() public method

Gives an array of project objects starting from the current project then its parent, its parent and up to the root
public path_to_root ( ) : array
return array

regenerate_paths() public method

Regenrate the paths of all projects from its parents slugs
public regenerate_paths ( $parent_project_id = null )

restrict_fields() public method

Sets restriction rules for fields.
Since: 1.0.0
public restrict_fields ( GP_Validation_Rules $rules )
$rules GP_Validation_Rules The validation rules instance.

set_difference_from() public method

public set_difference_from ( $other_project )

source_url() public method

public source_url ( $file, $line )

source_url_template() public method

public source_url_template ( )

sub_projects() public method

public sub_projects ( )

top_level() public method

public top_level ( )

update_path() public method

Updates this project's and its chidlren's paths, according to its current slug.
public update_path ( )

Property Details

$active public property

public $active

$description public property

public $description

$field_names public property

public $field_names

$id public property

public $id

$int_fields public property

public $int_fields

$name public property

public $name

$non_updatable_attributes public property

public $non_updatable_attributes

$parent_project_id public property

public $parent_project_id

$path public property

public $path

$slug public property

public $slug

$source_url_template public property

public $source_url_template

$table_basename public property

public $table_basename

$user_source_url_template public property

public $user_source_url_template