GBContent::applyInfoFromCommits PHP Method

applyInfoFromCommits() protected method

protected applyInfoFromCommits ( $commits )
    protected function applyInfoFromCommits($commits)
    {
        if (!$commits) {
            return;
        }
        gb::event('will-apply-info-from-commits', $this, $commits);
        # latest one is last modified
        $this->modified = $commits[0]->authorDate;
        # first one is when the content was created
        $initial = $commits[count($commits) - 1];
        $this->published = $initial->authorDate;
        if (!$this->author) {
            $this->author = new GBAuthor($initial->authorName, $initial->authorEmail);
        }
        gb::event('did-apply-info-from-commits', $this, $commits);
    }