OWeb/defaults/models/programs/Programs.php
public function getprogram($id)
    {

        if (isset($this->programs[$id]))
            return $this->programs[$id];
        else {

            try {

                $programs = $this->getProgramsArray(array($id));

                if(isset($programs[$id])){
                    return $programs[$id];
                }else{
                    throw new ProgramNotFound("Couldn't get Program with id : $id . NO such program", 0);
                }

            } catch (\Exception $ex) {
                throw new ProgramNotFound("Couldn't get Program with id : $id . ERROR", 0, $ex);
            }
        }
    }
public function getprogram($id)
    {

        if (isset($this->programs[$id]))
            return $this->programs[$id];
        else {

            try {

                $programs = $this->getProgramsArray(array($id));

                if(isset($programs[$id])){
                    return $programs[$id];
                }else{
                    throw new ProgramNotFound("Couldn't get Program with id : $id . NO such program", 0);
                }

            } catch (\Exception $ex) {
                throw new ProgramNotFound("Couldn't get Program with id : $id . ERROR", 0, $ex);
            }
        }
    }
public function getprogram ( $ id ) { if ( isset ( $ this -> programs [ $ id ] ) ) return $ this -> programs [ $ id ] ; else { try { $ programs = $ this -> getProgramsArray ( array ( $ id ) ) ; if ( isset ( $ programs [ $ id ] ) ) { return $ programs [ $ id ] ; } else { throw new ProgramNotFound ( "Couldn't get Program with id : $id . NO such program" , 0 ) ; } } catch ( \ Exception $ ex ) { throw new ProgramNotFound ( "Couldn't get Program with id : $id . ERROR" , 0 , $ ex ) ; } } }
Recovers the Program with the demanded ID
@param $id
@return Program
@throws exception\ProgramNotFound thrown if this program doesn't exist or there is a problem with the DB
Recovers the Program with the demanded ID