PHP code example of orangecat / module-company-methods

1. Go to this page and download the library: Download orangecat/module-company-methods library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

orangecat / module-company-methods example snippets


public function getEntityId();
public function setEntityId($entityId);
public function getCompanyId(): int;
public function setCompanyId(int $companyId): self;
public function getMethodType(): string;   // 'payment' | 'shipping'
public function setMethodType(string $methodType): self;
public function getMethodCode(): string;   // e.g. 'checkmo', 'flatrate_flatrate'
public function setMethodCode(string $methodCode): self;

public function save(CompanyMethodsInterface $method): CompanyMethodsInterface;
public function getById(int $entityId): CompanyMethodsInterface;
public function getByCompanyId(int $companyId): array;
public function getMethodsByCompanyAndType(int $companyId, string $type): array;  // returns string[]
public function deleteByCompanyId(int $companyId): bool;
public function deleteByCompanyIdAndType(int $companyId, string $type): bool;