DataSift\Storyplayer\PlayerLib\Story::determineStoryFilename PHP Method

determineStoryFilename() public method

public determineStoryFilename ( ) : void
return void
    public function determineStoryFilename()
    {
        $trace = debug_backtrace();
        $this->storyFilename = $trace[1]['file'];
    }

Usage Example

Example #1
0
/**
 * 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;
}