public function determineStoryFilename() { $trace = debug_backtrace(); $this->storyFilename = $trace[1]['file']; }
/** * Create a new story object * * @param string $category the category that the story belongs to * @return Story the new story object to use */ function newStoryFor($category) { $story = new Story(); $story->setCategory($category); // our output reports may need to know which file the story itself // is defined in $story->determineStoryFilename(); return $story; }