PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/apps/todo/domain/TodoListCollection.php

http://zoop.googlecode.com/
PHP | 30 lines | 23 code | 5 blank | 2 comment | 2 complexity | 6f535efc9ea27e0c4a38272bbd80e0eb MD5 | raw file
 1<?php
 2class TodoListCollection extends Object
 3{
 4	var $dir;
 5	
 6	function __construct($dir)
 7	{
 8		$this->addGetter('todoListNames');
 9		$this->dir = $dir;
10	}
11	
12	function getTodoListNames()
13	{
14		//$parser = new TodoListParser();
15		//$lists = array();
16		
17		$listNames = array();
18		
19		$d = dir($this->dir);
20		while(false !== ($entry = $d->read()))
21		{
22			$parts = explode('.', $entry);
23			if(array_pop($parts) == 'todo')
24				$listNames[] = $entry;
25		}
26		$d->close();
27		
28		return $listNames;
29	}
30}