Pap_Api_Object::__construct PHP Method

__construct() public method

public __construct ( Gpf_Api_Session $session )
$session Gpf_Api_Session
        public function __construct(Gpf_Api_Session $session)
        {
            $this->session = $session;
            $this->fields = new Gpf_Data_IndexedRecordSet(self::FIELD_NAME);
            $header = new Gpf_Data_RecordHeader();
            $header->add(self::FIELD_NAME);
            $header->add(self::FIELD_VALUE);
            $header->add(self::FIELD_VALUES);
            $header->add(self::FIELD_OPERATOR);
            $header->add(self::FIELD_ERROR);
            $this->fields->setHeader($header);
        }

Usage Example

 public function __construct(Gpf_Api_Session $session) {
     if($session->getRoleType() == Gpf_Api_Session::AFFILIATE) {
         throw new Exception("This class can be used only by merchant!");
     } else {
         $this->class = "Pap_Merchants_Transaction_TransactionsForm";
     }
      
     parent::__construct($session);
 }
All Usage Examples Of Pap_Api_Object::__construct