Created
May 29, 2014 20:11
-
-
Save krusynth/212f67260f701812c6fa to your computer and use it in GitHub Desktop.
State Decoded parser for San Francisco for American Legal data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* San Francisco parser for State Decoded. | |
* Extends AmericanLegal base classes. | |
* | |
* PHP version 5 | |
* | |
* @license http://www.gnu.org/licenses/gpl.html GPL 3 | |
* @version 0.8 | |
* @link http://www.statedecoded.com/ | |
* @since 0.3 | |
*/ | |
/** | |
* This class may be populated with custom functions. | |
*/ | |
require 'class.AmericanLegal.inc.php'; | |
class State extends AmericanLegalState {} | |
class Parser extends AmericanLegalParser | |
{ | |
/* | |
* Most codes have a Table of Contents as the first LEVEL. | |
*/ | |
public function pre_parse_chapter(&$chapter) | |
{ | |
// If there's more than one title,this has a table of contents. | |
if(count($chapter->REFERENCE->TITLE) > 1) | |
{ | |
if(count($chapter->LEVEL->LEVEL) > 1) | |
{ | |
$this->logger->message('Skipping first level.', 2); | |
unset($chapter->LEVEL->LEVEL[0]); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment