3 class ReadifoodObject extends BaseObject {
5 $class = get_class($this->getPeer());
6 return sprintf("/%s/%s/%d", urlencode(strtolower($class::OM_CLASS)), urlencode($this->getName()), $this->getId());
9 function getLink($blurb = null, $url = null, $classes = null) {
10 if (is_null($classes)) $classes = array();
11 else if (! is_array($classes)) $classes = array($classes);
12 return sprintf("<a %shref=\"%s\">%s</a>", (count($classes)) ? "class=\"" . implode(" ", $classes) . "\" " : "", (isset($url)) ? $url : $this->getURL(), (isset($blurb)) ? htmlspecialchars($blurb) : htmlspecialchars($this->getName()));
15 function getStrongLink($blurb = null, $url = null) {
16 return $this->getLink($blurb, $url, "strong");
19 function getActionLink($action, $blurb, $classes = null) {
20 if (is_null($classes)) $classes = array();
21 else if (! is_array($classes)) $classes = array($classes);
22 return $this->getLink($blurb, sprintf("%s/%s", $this->getURL(), urlencode($action)), array_unique(array_merge($classes, array("small"))));
25 function getDeleteLink() {
26 return $this->getActionLink("delete", "Delete", array("delete", "noprint"));