Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 6
CRAP
0.00% covered (danger)
0.00%
0 / 41
CollegeExtraDetailsService
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 6
110.00
0.00% covered (danger)
0.00%
0 / 41
 __construct
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 __clone
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getInstance
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 4
 collegeExtraDetails
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 12
 getExtraDetailsByNameAndModule
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 12
 geExtraDetailsOfModule
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 11
<?php
namespace com\linways\core\ams\professional\service;
use com\linways\core\ams\professional\exception\ProfessionalException;
class CollegeExtraDetailsService extends BaseService {
    private static $_instance = null;
    
    // /Condition 2 - Locked down the constructor
    private function __construct() {
    }
    // Prevent any oustide instantiation of this class
    
    // /Condition 3 - Prevent any object or instance of that class to be cloned
    private function __clone() {
    }
    // Prevent any copy of this object
    
    // /Condition 4 - Have a single globally accessible static method
    public static function getInstance() {
        if (! is_object ( self::$_instance )) // or if( is_null(self::$_instance) ) or if( self::$_instance == null )
            self::$_instance = new self ();
        
        return self::$_instance;
    }
    
    /**
     * Method for getting collge extra details
     * @param unknown $examType
     * @throws ProfessionalException
     * @author Ranjith Balachandran
     */
    
    public function collegeExtraDetails($examType)
    {
        $sql = '';
        
        $examType = $this->realEscapeObject($examType);
        
        $collegeExtraDetails = null;
        
        try{
            $sql = "SELECT bankName,bankCode,accountNo,branchName,place,feeCode,examType FROM collegeExtraDetailsSettings WHERE examType = '$examType'";
            $collegeExtraDetails = $this->executeQueryForObject($sql);
            
        }catch (\Exception $e){
            throw new ProfessionalException($e->getCode(),$e->getMessage());
        }
        
        return $collegeExtraDetails;
    }
    /**
     * get extra details by column name and type
     * @author Aswin
     * @param  $name
     * @param  $module
     * @throws ProfessionalException
     * @return object|array|\com\linways\base\util\$objectList[]
     */
    public function getExtraDetailsByNameAndModule($name,$module)
    {
        $name=$this->realEscapeString($name);
        $module=$this->realEscapeString($module);
        $query="select $name from collegeExtraDetailsSettings where module='$module'";
        try{
            $response=$this->executeQueryForList($query);
        }catch(\Exception $e)
        {
            throw new ProfessionalException($e->getCode(),$e->getMessage());
        }
        return $response;
    }
    /**
     * get extra details of module
     * @param  $module
     * @throws ProfessionalException
     * @return object|array|\com\linways\base\util\$objectList[]
     */
    public function geExtraDetailsOfModule($module)
    {
        $module=$this->realEscapeString($module);
        $query="select bankName,bankCode,accountNo,branchName,place,feeCode,examType,phoneNo from collegeExtraDetailsSettings where module='$module'";
        try{
            $response=$this->executeQueryForObject($query);
        }catch(\Exception $e)
        {
            throw new ProfessionalException($e->getCode(),$e->getMessage());
        }
        return $response;
    }
}