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

Class: File_Therion_Survey

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

Class Overview

File_Therion_BasicObject
   |
   --File_Therion_Survey

Class representing a therion survey 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 25]
Class representing a therion survey object.


[ Top ]


Class Variables

$_centrelines = array()

[line 50]

Associated centrelines
  • Access: protected

Type:   array


[ Top ]

$_joins = array()

[line 65]

Associated scrap joins
  • Access: protected

Type:   array


[ Top ]

$_maps = array()

[line 72]

Associated maps
  • Var: of map objects
  • Access: protected

Type:   array


[ Top ]

$_name =  null

[line 86]

survey name (ID)
  • Access: protected

Type:   array


[ Top ]

$_options = array(
        'title'       => "",
        'declination' => null, // different string forms possible, including []
        'entrance'    => "",   // name of station: "survey ... -entrance 1.0"
        'namespace'   => ""
    )

[line 93]

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

Type:   array
Overrides:   Array


[ Top ]

$_parent =  null

[line 43]

Associated parent survey
  • Access: protected



[ Top ]

$_scraps = array()

[line 58]

Associated scraps
  • Access: protected

Type:   array


[ Top ]

$_surface = array()

[line 79]

Associated surface definitions
  • Var: of surface objects
  • Access: protected

Type:   array


[ Top ]

$_surveys = array()

[line 36]

Associated subsurvey structures
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 113]

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

Create a new therion survey object.

Survey ID is a therion keyword, thus restricted to a sequence of A-Z, a-z, 0-9 and _-/ characters (not starting with ‘-’). If you want to set an alternate cleartext name, use

  1. $survey->setOption('your survey name');
.

  • Access: public

Parameters:

string   $id   —  ID of the survey (note this is a therion keyword)
array   $options   —  associative options array to set

[ Top ]

addCentreline   [line 712]

void addCentreline( File_Therion_Centreline $centreline)

Add a centreline definition.

This will implicitely update the centrelines survey context.

Example:

  1.  $centreline = new File_Therion_Centreline();
  2.  // $centreline->....
  3.  $survey->addCentreline($centreline);

  • Access: public

Parameters:

File_Therion_Centreline   $centreline   —  Centreline object to add

[ Top ]

addJoin   [line 815]

void addJoin( File_Therion_Join $join)

Add a scrap join.

Example:

  1.  $join = new File_Therion_Join($someScrap$otherScrap);
  2.  $survey->addJoin($join);

  • Access: public

Parameters:

File_Therion_Join|array   $join   —  Single or multiple joins.

[ Top ]

addMap   [line 850]

void addMap( File_Therion_Map $map)

Add a map definition.

Example:

  1.  $map = new File_Therion_Map("fooMap");
  2.  // $map->....
  3.  $survey->addMap($map);

  • Access: public

Parameters:

File_Therion_Map   $map   —  Map object to add

[ Top ]

addScrap   [line 781]

void addScrap( File_Therion_Scrap $scrap)

Add a scrap object.

Example:

  1.  $scrap = new File_Therion_Scrap("fooScrap");
  2.  // $scrap->....
  3.  $survey->addScrap($scrap);

  • Access: public

Parameters:

File_Therion_Scrap   $scrap   —  Map object to add

[ Top ]

addSurface   [line 885]

void addSurface( File_Therion_Surface $surface)

Add a surface definition.

Example:

  1.  $surface = new File_Therion_Surface();
  2.  // $surface->....
  3.  $survey->addMap($surface);

  • Access: public

Parameters:

File_Therion_Surface   $surface   —  Surface object to add

[ Top ]

addSurvey   [line 610]

void addSurvey( File_Therion_Survey $subsurvey)

Add a subsurvey.

Adds a survey as subsurvey to this survey and updates its parent reference.

A File_Therion_Exception is thrown, when the child survey is already present as one of the parents.

Example:

  1.  $subsurvey = new File_Therion_Survey("fooSurvey");
  2.  // $subsurvey->....
  3.  $survey->addSurvey($subsurvey);

  • Todo: unreference children from old parent when reassigning children
  • Throws: File_Therion_Exception at loop reference
  • Access: public

Parameters:

{@link   $subsurvey   —  File_Therion_Survey} $subsurvey Survey object to add

[ Top ]

clearCentrelines   [line 721]

void clearCentrelines( )

Remove associated centrelines.
  • Access: public

[ Top ]

clearJoins   [line 823]

void clearJoins( )

Clean existing scrap joins.
  • Access: public

[ Top ]

clearMaps   [line 858]

void clearMaps( )

Remove associated maps.
  • Access: public

[ Top ]

clearScraps   [line 789]

void clearScraps( )

Remove associated scraps.
  • Access: public

[ Top ]

clearSurface   [line 893]

void clearSurface( )

Remove associated surface definitions.
  • Access: public

[ Top ]

clearSurveys   [line 631]

void clearSurveys( )

Remove associated subsurveys.
  • Access: public

[ Top ]

count   [line 914]

int count( )

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

[ Top ]

getAllStations   [line 748]

array getAllStations( [int $maxDepth = 0])

Get all stations defined in all centrelines.

By default, only returns stations local to this survey. With $maxDepth you can swith on recursion:

  • -1 = recurse endlessly
  • 0 = only local stations (default)
  • >1 = recurse down to this level (1=first child level, etc)


Parameters:

int   $maxDepth   — 

[ Top ]

getCentrelines   [line 731]

array getCentrelines( )

Get existing Centrelines objects.
  • Return: of File_Therion_Centreline objects
  • Access: public

[ Top ]

getEquates   [line 515]

array getEquates( [int $maxDepth = 0])

Get equated stations of this survey.

All local stations with valid equates (viewed from this survey) are returned as array of File_Therion_Station), because, etc), those, wo, this, yougetAllStations()) and testing each station for equates.


Parameters:

int   $maxDepth   —  recursion depth

[ Top ]

getJoins   [line 833]

array getJoins( )

Get existing scrap joins.

[ Top ]

getMaps   [line 868]

array getMaps( )

Get existing Map objects.
  • Return: of File_Therion_Map objects
  • Access: public

[ Top ]

getName   [line 463]

string getName( )

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

[ Top ]

getParent   [line 693]

null|File_Therion_Survey getParent( )

Returns the parent survey of this survey.

Returns null when this survey has no parent set.

  • Access: public

[ Top ]

getScraps   [line 799]

array getScraps( )

Get existing Scrap objects.
  • Return: of File_Therion_Scrap objects
  • Access: public

[ Top ]

getSurfaces   [line 903]

array getSurfaces( )

Get existing surface objects.
  • Return: of File_Therion_Surface objects
  • Access: public

[ Top ]

getSurveys   [line 646]

array getSurveys( [string|File_Therion_Survey $survey = null])

Get existing subsurveys.

You may query for a survey in which case either the survey is returned or throws an OutOfBoundsException when not found.

  • Return: of File_Therion_Survey objects
  • Throws: OutOfBoundsException if no named survey is found.
  • Access: public

Parameters:

string|File_Therion_Survey   $survey   —  Query for named survey

[ Top ]

parse   [line 135]

File_Therion_Survey parse( array $lines)

Parses given Therion_Line-objects into internal data structures.
  • Return: Survey object
  • Todo: implement me
  • Throws: File_Therion_SyntaxException for therion syntax errors
  • Throws: InvalidArgumentException
  • Access: public

Parameters:

array   $lines   —  array of File_Therion_Line objects containing a survey

[ Top ]

setName   [line 474]

string setName( $id)

Change name (id) of this survey.
  • Todo: implement parameter checks
  • Access: public

Parameters:

   $id   — 

[ Top ]

setParent   [line 681]

void setParent( [File_Therion_Survey $parent = null])

Sets the parent survey of this survey.

Note that in contrast to addSurvey(), no references in the parent will be updated: The parent does not know of its child. It's mainly called by addSurvey() but may be used to create fake survey structures manually (may come in handy for equate and friends together with only partial survey data available as PHP objects).

  • Access: public

Parameters:

File_Therion_Survey|null   $parent   —  Use null to reset parent

[ Top ]

toLines   [line 341]

array toLines( )

Generate line content from this object.
  • Return: File_Therion_Line objects
  • Todo: combine equates for nicer output
  • Todo: finish implementation, implement proper escaping
  • Access: public

[ Top ]


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