Skip to content

Instantly share code, notes, and snippets.

@krusynth
Created May 29, 2014 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krusynth/212f67260f701812c6fa to your computer and use it in GitHub Desktop.
Save krusynth/212f67260f701812c6fa to your computer and use it in GitHub Desktop.
State Decoded parser for San Francisco for American Legal data
<?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