Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • Blueprint
  • BlueprintNode
  • BreadcrumbElement
  • Content
  • ContentModel
  • CopyOperation
  • DeleteOperation
  • EditBlock
  • ExportBlock
  • ExportOperation
  • Hooks
  • ImportOperation
  • LanguagesElement
  • ListView
  • ManageBlock
  • Model
  • Module
  • NavigationBranchElement
  • NavigationElement
  • NavigationExcludeOperation
  • NavigationIncludeOperation
  • Page
  • PageController
  • PopPage
  • PopTemplate
  • QueryOperationOperation
  • SaveOperation
  • TemplateEditorsOperation
  • UpdateTreeOperation

Class Blueprint

A simplified data structure representing the relashionship between pages.

Namespace: Icybee\Modules\Pages
See: Icybee\Modules\Pages\BlueprintNode
Located at vendor/icanboogie-modules/pages/lib/blueprint.php

Methods summary

public static Icybee\Modules\Pages\Blueprint
# from( ICanBoogie\ActiveRecord\Query $query )

Creates a Icybee\Modules\Pages\Blueprint instance from an ActiveRecord\Query.

Creates a Icybee\Modules\Pages\Blueprint instance from an ActiveRecord\Query.

Parameters

$query
ICanBoogie\ActiveRecord\Query
$query

Returns

Icybee\Modules\Pages\Blueprint
protected
# __construct( Icybee\Modules\Pages\Model $model, array $relation, array $children, array $index, array $tree )

The blueprint is usualy constructed by the Icybee\Modules\Pages\Model::blueprint() method or the Icybee\Modules\Pages\Blueprint::subset() method.

The blueprint is usualy constructed by the Icybee\Modules\Pages\Model::blueprint() method or the Icybee\Modules\Pages\Blueprint::subset() method.

Parameters

$model
Icybee\Modules\Pages\Model
$model
$relation
array
$relation The child/parent relations.
$children
array
$children The parent/children relations.
$index
array
$index Pages index.
$tree
array
$tree Pages nested as a tree.
public mixed
# __get( string $property )

Support for the $ordered_records property.

Support for the $ordered_records property.

Parameters

$property
string
$property

Returns

mixed

Throws

ICanBoogie\PropertyNotDefined
in attempt to get a property that is not defined or supported.
protected
# get_ordered_nodes( )
protected array[int]ActiveRecord
# get_ordered_records( )

Returns the records of the blueprint ordered according to their position and relation.

Returns the records of the blueprint ordered according to their position and relation.

Note: The blueprint is populated with records if needed.

Returns

array[int]ActiveRecord
public boolean
# has_children( integer $nid )

Checks if a branch has children.

Checks if a branch has children.

Parameters

$nid
integer
$nid Identifier of the parent record.

Returns

boolean
public integer
# children_count( integer $nid )

Returns the number of children of a branch.

Returns the number of children of a branch.

Parameters

$nid
integer
$nid The identifier of the parent record.

Returns

integer
public Icybee\Modules\Pages\Blueprint
# subset( integer $nid = null, integer $depth = null, callable $filter = null )

Create a subset of the blueprint.

Create a subset of the blueprint.

A filter can be specified to filter out the nodes of the subset. The function returns true to discart a node. The callback function have the following signature:
function(BlueprintNode $node)

The following example demonstrate how offline nodes cen be filtered out.

<?php

use Icybee\Modules\Pages\BlueprintNode;

$subset = $core->models['pages']
->blueprint($site_id = 1)
->subset(null, null, function(BlueprintNode $node) {

    return !$node->is_online;

});

Parameters

$nid
integer
$nid Identifier of the starting branch.
$depth
integer
$depth Maximum depth of the subset.
$filter
callable
$filter The filter callback.

Returns

Icybee\Modules\Pages\Blueprint
public array[int]\Icybee\Modules\Pages\Page
# populate( )

Populates the blueprint by loading the associated records.

Populates the blueprint by loading the associated records.

The method adds the record property to the blueprint nodes.

Returns

array[int]\Icybee\Modules\Pages\Page

Magic methods summary

Properties summary

public array[int]int $relation
#

The child/parent relation.

The child/parent relation.

An array where each key/value is the identifier of a node and the idenfier of its parent, or zero if the node has no parent.

public array[int]array $children
#

The parent/children relation.

The parent/children relation.

An array where each key/value is the identifier of a parent and an array made of the identifiers of its children. Each key/value pair of the children value is made of the child identifier.

public array[int]BlueprintNode $index
#

Index of the blueprint nodes.

Index of the blueprint nodes.

Blueprint nodes are instances of the Icybee\Modules\Pages\BlueprintNode class. The key of the index is the identifier of the node, while the value is the node instance.

public array[int]BlueprintNode $tree
#

Pages nested as a tree.

Pages nested as a tree.

public ICanBoogie\ActiveRecord\Model $model
#

Model associated with the blueprint.

Model associated with the blueprint.

Autodoc API documentation generated by ApiGen 2.8.0