added phpDocumentors .ini config

addded documentation
This commit is contained in:
Steffen Vogel 2010-07-22 11:13:11 +02:00
parent dcad7f6c80
commit 49bb30be2c
6 changed files with 43 additions and 44 deletions

View file

@ -26,12 +26,12 @@ use \Volkszaehler\Model;
/**
* channel controller
*
* @author Steffen Vogel <info@steffenvogel.de>
*
* @author Steffen Vogel <info@steffenvogel.de>
* @package channel
*/
class Channel extends Controller {
// TODO authentification/indentification
public function get() {
$dql = 'SELECT c FROM Volkszaehler\Model\Channel c';
@ -39,64 +39,64 @@ class Channel extends Controller {
if ($this->view->request->getParameter('uuid')) {
// TODO add conditions
}
if ($this->view->request->getParameter('ugid')) {
// TODO add conditions
}
if ($this->view->request->getParameter('indicator')) {
// TODO add conditions
}
$q = $this->em->createQuery($dql);
$channels = $q->getResult();
foreach ($channels as $channel) {
$this->view->add($channel);
}
}
/**
* add channel
*
*
* @todo validate input and throw exceptions
*/
public function add() {
$channel = new Model\Channel\Meter($this->view->request->getParameter('indicator'));
$channel->setName($this->view->request->getParameter('name'));
$channel->setDescription($this->view->request->getParameter('description'));
$channel->setResolution($this->view->request->getParameter('resolution'));
$channel->setCost($this->view->request->getParameter('cost'));
$this->em->persist($channel);
$this->em->flush();
$this->view->add($channel);
}
/**
* delete channel
*
*
* @todo authentification/indentification
*/
public function delete() {
$ucid = $this->view->request->getParameter('ucid');
$channel = $this->em->getRepository('Volkszaehler\Model\Channel\Channel')->findOneBy(array('uuid' => $ucid));
$this->em->remove($channel);
$this->em->flush();
}
/**
* edit channel properties
*
*
* @todo authentification/indentification
* @todo to be implemented
*/
public function edit() {
}
}

View file

@ -1,6 +1,7 @@
<?php
/**
* @copyright Copyright (c) 2010, The volkszaehler.org project
* @package default
* @license http://www.opensource.org/licenses/gpl-license.php GNU Public License
*
* This file is part of volkzaehler.org
@ -23,14 +24,14 @@ namespace Volkszaehler\Controller;
/**
* controller superclass for all controllers
*
* @author Steffen Vogel <info@steffenvogel.de>
*
* @author Steffen Vogel <info@steffenvogel.de>
* @package default
*/
abstract class Controller {
protected $view;
protected $em;
/**
* constructor
*/
@ -38,17 +39,17 @@ abstract class Controller {
$this->view = $view;
$this->em = $em;
}
/**
* run controller actions
*
*
* @param string $action runs the action if class method is available
*/
public function run($action) {
if (!method_exists($this, $action)) {
throw new \InvalidArgumentException('\'' . $action . '\' is not a valid controller action');
}
$this->$action();
}
}

View file

@ -29,6 +29,7 @@ use Volkszaehler\Util;
*
* @author Steffen Vogel <info@steffenvogel.de>
* @todo call via redirect from Controller\Channel
* @package data
*/
class Data extends Controller {

View file

@ -24,51 +24,51 @@ namespace Volkszaehler\Controller;
/**
* group controller
*
* @author Steffen Vogel (info@steffenvogel.de)
*
* @author Steffen Vogel (info@steffenvogel.de)
* @package group
*/
class Group extends Controller {
/**
*
*
*/
public function get() {
// TODO get groups from entitymanager according to API specs
foreach ($groups as $group) {
$this->view->addGroup($group);
}
}
/**
*
*
*/
public function add() {
$group = new Group();
$group->name = $this->view->request->getParameter('name');
$group->description = $this->view->request->getParameter('description');
$this->em->persist($group);
$this->em->flush();
$this->view->add($group);
}
/**
* @todo authentification/indentification
*/
public function delete() {
$group = Group::getByUuid($this->view->request->getParameter('ugid'));
$this->em->remove($group);
$this->em->flush();
}
/**
* edit group properties
*
*
* @todo implement Controller\Group::edit()
*/
public function edit() {

View file

@ -39,6 +39,7 @@ interface InterpreterInterface {
* interpreter superclass for all interpreters
*
* @author Steffen Vogel <info@steffenvogel.de>
* @package data
*
*/
abstract class Interpreter implements InterpreterInterface {

View file

@ -32,8 +32,4 @@ git pull
cd /var/www/vz/
# update dokumentation
phpdoc/phpdoc --directory github --target docs \
--title "volkszaehler.org Documentation" \
--output HTML:frames:phpedit \
--ignoresymlinks \
--ignore backend/lib/vendor/,backend/lib/Model/Proxies/
phpdoc/phpdoc --config /var/www/vz/github/share/tools/phpdoc.ini