/** * Returns an array of strings for each fatal error in the given MOC's data */ public function errors() { if ($this->code == "") { return array("code cannot be empty"); } // Dupe checking $all = MOC::all(); foreach ($all as $oldmoc) { if ($oldmoc->code == $this->code) { return array("code must be unique"); } } return array(); }
<?php require_once __DIR__ . "/includes/root.php"; must_allow("manage mocs"); $mocs = MOC::all(); $renderer->variable("mocs", $mocs); $renderer->variable("title", "MARC Org Code List"); $renderer->render("mocs-list");