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

Class: File_Therion_BasicObject

Source Location: /File_Therion-0.4.1/File/Therion/BasicObject.abstract.php

Class Overview


Abstract Class representing a basic therion object.


Author(s):

Copyright:

  • 2016 Benedikt Hallinger

Variables

Methods


Child classes:

File_Therion_Scrap
Class representing a therion scrap object.
File_Therion_Centreline
Class representing a therion centreline object.
File_Therion_ScrapPoint
Class representing a scrap point definition object.
File_Therion_Surface
Class representing a therion surface object.
File_Therion_ScrapLine
Class representing a scrap line definition object.
File_Therion_Survey
Class representing a therion survey object.
File_Therion_ScrapArea
Class representing a scrap area definition object.
File_Therion_Map
Class representing a therion map definition object.
File_Therion_Grade
Class representing a therion grade definition object.
File_Therion_Join
Class representing a join definition object.

Inherited Variables

Inherited Methods


Class Details

[line 46]
Abstract Class representing a basic therion object.

It features some common functions to set/get basic data elements. The interface is restricted because other than options should be explicitely defined with getters/setters.



[ Top ]


Class Variables

$objStack = array()

[line 56]

Object data stack.

Therion objects can be ordered, so that the representing lines are generated in a specific order. A multiline therion command can hold several such objects.

  • Access: protected

Type:   mixed


[ Top ]

$_options = array(
        // In subclasses: add here the valid options and datatypes
        // 'title' => "",
        // 'id'    => 0,
        // 'array' => array(),
    )

[line 68]

Object options (title, ...).

This defines the options available in the concrete object. When inheriting from this class, redeclare the array.

  • Var: assoc array
  • See: _getSet_dataOrOption()
  • Access: protected

Type:   array


[ Top ]

$_simpledata = array(
        // In subclasses: add here the valid options and datatypes
        // 'team'        => array(),
        // 'explo-team'  => array(),
        // 'declination' => 0.0,
    )

[line 83]

Object data (simple ones).

When inheriting from this class, redeclare the array and remember to define explicit setters/getters to access those elements.

  • Var: assoc array
  • Access: protected

Type:   array


[ Top ]



Method Detail

addComment   [line 361]

void addComment( string $text)

Add a comment.

NOTICE: The current implementation does not support object ordering. Currently this is only useful for generating embedded header comments for Surveys and Centerlines.

  • Todo: support object ordering (see class comment todo in File_Therion_BasicObject)
  • Access: public

Parameters:

string   $text   — 

[ Top ]

getData   [line 286]

mixed getData( string $key)

Get some simple data of this object.

Dev-Note: real object data should be accessbile to the end user only through explicitely named functions.

  • Return: depending on option
  • See: $_data
  • Throws: InvalidArgumentException when option is not defined
  • Access: protected

Parameters:

string   $key   —  data key to get

[ Top ]

getOption   [line 197]

mixed getOption( string $option)

Get option of this object.

Overridden in child classes as:

File_Therion_ScrapArea::getOption()
Options with area objects are not supported by therion.

Parameters:

string   $option   —  option key to get

[ Top ]

getOptionsString   [line 303]

string getOptionsString( )

Generate basic options string.

For options that are not null a string will be added with the value: "-<option> <value>"

  • string value: will be escaped and added unless empty
  • array value: will be joined with space and then escaped as single value unless empty

  • Access: public

[ Top ]

handleCommonOption   [line 218]

boolean handleCommonOption( string $option, [mixed $value = null])

Handle known options supported by several objects.

Some options are common to several objects and need enhanced parsing. This is centralized here. Note that this funcion should only be used after a call to _verify() so it is assured the key exists in the specific class.

  • Return: true = handling performed, no further action needed.
  • Throws: File_Therion_SyntaxException on syntax errors (eg missing values)
  • Access: protected

Parameters:

string   $option   —  to try to handle
mixed   $value   —  value to handle

[ Top ]

setData   [line 259]

void setData( array $key, [array $value = null])

Set some simple data of this object.

Dev-Note: real object data should be accessible to the end user only through explicitely named functions.

The key and datatype will be checked against the $_data array.

  • See: $_data
  • Throws: InvalidArgumentException when option is not defined
  • Access: protected

Parameters:

array   $key   —  name (or associative array of data) to set
array   $value   —  when $key is no array: value to set

[ Top ]

setOption   [line 161]

void setOption( array $option, [array $value = null])

Set options of this object.

The key and datatype will be checked against the $_options array.

There are two call modes:


Overridden in child classes as:

File_Therion_ScrapArea::setOption()
Options with area objects are not supported by therion.

Parameters:

array   $option   —  option (or associative array of options) to set
array   $value   —  when $options is no array: value to set

[ Top ]

_verify   [line 103]

true _verify( string $type, [string $key = null], [string $value = null], [string $altname = ""])

Verify basic compliance of item.

This will test existence and type of the passed key and value and throw an appropriate exception in case of problems.

  • Return: in case everything was ok
  • Throws: InvalidArgumentException in case of verification failure
  • Access: protected

Parameters:

string   $type   —  name of local object variable
string   $key   —  key to check (if != null)
string   $value   —  value to check against (if != null)
string   $altname   —  alternative type-name for error output

[ Top ]


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