AppStateESS/homestead

View on GitHub
class/ApplicationFeatureFactory.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Homestead;

use \Homestead\Exception\DatabaseException;

class ApplicationFeatureFactory
{
    public static function getForTerm($term)
    {
        $db = new \PHPWS_DB('hms_application_feature');
        $db->addWhere('term', $term);
        $result = $db->getObjects('\Homestead\ApplicationFeature');

        if(\PHPWS_Error::logIfError($result)) {
            throw new DatabaseException($result->toString());
        }

        // TODO: Reorg so the array is indexed by the class name.

        return $result;
    }
}