TODO List (PHP, PDO, SQLite)

Download Sources

Example of how to use generated data access code

$ds = new PDODataStore();

$ds->open();

$tasks_dao = new dao\TasksDao($ds);

$tasks = $tasks_dao->getGroupTasks($g_id); // $task_dao->... are visible for code assistance

foreach ($tasks as $t) { // $t->... are visible for code assistance
    echo '<tr>';
    echo '<td>' . $t->getT_date() . '</td>' . PHP_EOL;
    /* ... */
    echo '</tr>';
}

$ds->close();

XML meta-program

<dto-classes>
    <dto-class name="Group" ref="get_groups.sql"/>
    <dto-class name="Task" ref="tasks"/>
</dto-classes>
<dao-class>
	<crud table="groups" dto="Group">
		<create method="createGroup" />
		<read method="readGroup" />
		<update method="updateGroup" />
		<delete method="deleteGroup" />
	</crud>
	<query-dto-list method="getGroups" ref="get_groups.sql" dto="Group" />
	<exec-dml method="deleteTasks(g_id)" ref="delete_group_tasks.sql" />
</dao-class>
<dao-class>
	<crud table="tasks" dto="Task">
		<create method="createTask" />
		<read method="readTask" />
		<update method="updateTask" />
		<delete method="deleteTask" />
	</crud>
	<query-dto-list method="getGroupTasks(g_id)" ref="get_group_tasks.sql" dto="Task" />
</dao-class>