/** * */ private function setPropertiesFromPath() { $fullSlug = Util::removeExtensionFromFilename($this->basename); // If there is an id in the path, set it on the object if (Util::stringContains('_', $fullSlug)) { $idExplodedSlug = explode('_', $fullSlug); $this->id = (int) $idExplodedSlug[0]; $fullSlug = $idExplodedSlug[1]; } $potentialDate = substr($fullSlug, 0, 10); // If there is an date in the path, set it on the object, and set the remaining string as the slug if (Util::isADate($potentialDate)) { $this->date = substr($fullSlug, 0, 10); $this->slug = substr($fullSlug, 11); } else { // If no date or id, set the slug $this->slug = $fullSlug; } }
public function __call($method, $args) { if (Util::stringBeginsWith($method, 'where')) { $value = $args[0]; return $this->whereMagic($method, $value); } }