File_Therion
[ class tree: File_Therion ] [ index: File_Therion ] [ all elements ]

Class: File_Therion_Map

Source Location: /File_Therion-0.4.1/File/Therion/Map.php

Class Overview

File_Therion_BasicObject
   |
   --File_Therion_Map

Class representing a therion map definition object.


Author(s):

Copyright:

  • 2016 Benedikt Hallinger

Variables

Methods


Inherited Variables

Inherited Methods

Class: File_Therion_BasicObject

File_Therion_BasicObject::addComment()
Add a comment.
File_Therion_BasicObject::getData()
Get some simple data of this object.
File_Therion_BasicObject::getOption()
Get option of this object.
File_Therion_BasicObject::getOptionsString()
Generate basic options string.
File_Therion_BasicObject::handleCommonOption()
Handle known options supported by several objects.
File_Therion_BasicObject::setData()
Set some simple data of this object.
File_Therion_BasicObject::setOption()
Set options of this object.
File_Therion_BasicObject::_verify()
Verify basic compliance of item.

Class Details

[line 27]
Class representing a therion map definition object.

A map is a collection of scraps or other maps to render togehter.



[ Top ]


Class Variables

$_data = array(
        'elements' => array(),// string names of references
'mode'=>""// map|scrap: for check in addElement()
)

[line 55]

Basic data elements.
  • Access: protected

Type:   array


[ Top ]

$_name =  null

[line 37]

Map name (ID)
  • Access: protected

Type:   array


[ Top ]

$_options = array(
        'title'      => "",
        'projection' => ""
    )

[line 44]

Map options (title, ...).
  • Var: assoc array
  • Access: protected

Type:   array
Overrides:   Array


[ Top ]



Method Detail

__construct (Constructor)   [line 66]

File_Therion_Map __construct( string $id, [ $options = array()])

Create a new therion Map object.
  • Access: public

Parameters:

string   $id   —  Name/ID of the map
   $options   — 

[ Top ]

addElement   [line 245]

void addElement( string|File_Therion_Scrap|File_Therion_Map $element, [int $index = -1], [bool $replace = false])

Add an (scrap or map) element reference to this map.

When adding a File_Therion_Scrap object, the scraps -id option will be used as reference. The same is true for File_Therion_Map. To resolve the line objects using a given scrap object, use dereferenceElements().

Note that Maps may contain scrap references of map references, but not both! Therion will complain.

The special "break" string may be used to adjust level rendering in the map output.

The optional index parameter allows to adjust the insertion point; the line will be inserted at the index, pushing already present content one line down (-1=end, 0=start, ...). When replacing, the selected index will be replaced.

Instead of $index 0 and -1 you can use the strings 'start'/'end', this will make your code more readable. Using

  1. addLine(...$lln - 1)
will use logical line number instead of the index (logical = index+1).

Note that for therion the ordering matters. See the therion documentation for more details.

  • Throws: InvalidArgumentException
  • Throws: File_Therion_SyntaxException
  • Throws: OutOfBoundsException when requested index is not available
  • Access: public

Parameters:

string|File_Therion_Scrap|File_Therion_Map   $element   —  reference
int   $index   —  At which logical position to add (-1=end, 0=first line, ...)
bool   $replace   —  when true, the target line will be overwritten

[ Top ]

clearElements   [line 357]

void clearElements( )

Clear referenced elements from this map.
  • Access: public

[ Top ]

count   [line 387]

int count( )

Count number of elements of this map (SPL Countable).
  • Return: number of subsurveys
  • Access: public

[ Top ]

dereferenceElements   [line 373]

array dereferenceElements( File_Therion_Survey $survey)

Dereference element references using given survey.

This will try to get the line objects by reference out of the scrap provided.

  • Return: of File_Therion_Scrap or File_Therion_Map objects
  • Todo: Implement me please
  • Access: public

Parameters:

File_Therion_Survey   $survey   —  Scrap used for lookup of references

[ Top ]

getElements   [line 348]

array getElements( )

Get referenced elements.
  • Return: of string-referenced object id's
  • Access: public

[ Top ]

getName   [line 192]

string getName( )

Get name (id) of this map.
  • Access: public

[ Top ]

parse   [line 80]

File_Therion_Map parse( array $lines)

Parses given Therion_Line-objects into internal data structures.
  • Return: Map object
  • Throws: InvalidArgumentException
  • Access: public

Parameters:

array   $lines   —  File_Therion_Line objects forming a map

[ Top ]

setName   [line 204]

string setName( $id)

Change name (id) of this map.
  • Todo: Restrict naming convention, not all characters are allowed!
  • Todo: implement parameter checks
  • Access: public

Parameters:

   $id   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:09:45 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.