Created
October 2, 2012 05:14
-
-
Save eggsurplus/3816301 to your computer and use it in GitHub Desktop.
A custom util function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //custom/Extension/application/Ext/Utils/getProjectTemplates.php | |
| function getProjectTemplates(){ | |
| static $projectTemplates = null; | |
| if(!$projectTemplates){ | |
| global $db; | |
| $query = "SELECT id, name FROM project where deleted = 0 and is_template = 1 order by name asc "; | |
| $result = $db->query($query, false); | |
| $projectTemplates = array(); | |
| $projectTemplates[''] = ''; | |
| while (($row = $db->fetchByAssoc($result)) != null) { | |
| $projectTemplates[$row['id']] = $row['name']; | |
| } | |
| } | |
| return $projectTemplates; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment