21grams, Memento and Irreversible

class 21grams{
    protected $chapters = array();

    public function playMovie(){
        $this->chapters = Edition::getChapters();

        $this->buildChapters();

        foreach( $this->chapters as $chapter ){
            $chapter->play();
        }
    }
   
    protected function buildChapters(){
        /* the magic happens here */
        shufle( $this->chapters );
    }
}

class Memento extends 21grams{
    public function playMovie(){
        parent::playMovie();
    }
}

class Irreversible extends 21grams{

    protected function buildChapters(){
        /* the magic happens here */
        $this->chapters = array_reverse( $this->chapters );
    }
}
Vote up this code1