You are here

class AbstractModel in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/PubSubHubbub/Model/AbstractModel.php \Zend\Feed\PubSubHubbub\Model\AbstractModel

Hierarchy

Expanded class hierarchy of AbstractModel

File

vendor/zendframework/zend-feed/src/PubSubHubbub/Model/AbstractModel.php, line 15

Namespace

Zend\Feed\PubSubHubbub\Model
View source
class AbstractModel {

  /**
   * Zend\Db\TableGateway\TableGatewayInterface instance to host database methods
   *
   * @var TableGatewayInterface
   */
  protected $db = null;

  /**
   * Constructor
   *
   * @param null|TableGatewayInterface $tableGateway
   */
  public function __construct(TableGatewayInterface $tableGateway = null) {
    if ($tableGateway === null) {
      $parts = explode('\\', get_class($this));
      $table = strtolower(array_pop($parts));
      $this->db = new TableGateway($table, null);
    }
    else {
      $this->db = $tableGateway;
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractModel::$db protected property Zend\Db\TableGateway\TableGatewayInterface instance to host database methods
AbstractModel::__construct public function Constructor