Phive\Queue\Pdo\PdoQueue::__construct PHP Method

__construct() public method

public __construct ( PDO $pdo, $tableName )
$pdo PDO
    public function __construct(\PDO $pdo, $tableName)
    {
        $driverName = $pdo->getAttribute(\PDO::ATTR_DRIVER_NAME);
        if (!$this->supportsDriver($driverName)) {
            throw new \InvalidArgumentException(sprintf('PDO driver "%s" is unsupported by "%s".', $driverName, get_class($this)));
        }
        $this->pdo = $pdo;
        $this->tableName = $tableName;
    }

Usage Example

 public function __construct(\PDO $pdo, $tableName, $routineName = null)
 {
     parent::__construct($pdo, $tableName);
     $this->routineName = $routineName ?: $this->tableName . '_pop';
 }