public static function fromModel(Bbx_Model $model) { $f = $model->id; try { $f .= '-' . $model->subject; } catch (Exception $e) { $f .= '-' . $model; } return substr(trim(Inflector::interscore($f)), 0, 48); }
public function url($absolute = false) { $url = $this->_parentModel->url($absolute); if ($this->_childModelName === get_class($this->_parentModel)) { return $url; } return $url . '/' . Inflector::pluralize(Inflector::interscore($this->_childModelName)); }
public function activeLinks() { $links = array_merge($this->_alwaysLinked, array_fill_keys($this->activeRelationships(), null)); $active = array(); foreach ($links as $name => $link) { if (!in_array($name, $this->_neverLinked)) { $link = $link ? $link : $name; $active[$name] = implode('/', array($this->url(), Inflector::interscore($link))); } } return $active; }