Spot\Query::entityName PHP Method

entityName() public method

Get current entity name query is to be performed on
public entityName ( ) : string
return string
    public function entityName()
    {
        return $this->_entityName;
    }

Usage Example

Example #1
0
 /**
  * Return result set for current query
  */
 public function toCollection(\Spot\Query $query, $stmt)
 {
     $mapper = $query->mapper();
     $entityClass = $query->entityName();
     if ($stmt instanceof \PDOStatement) {
         // Set PDO fetch mode
         $stmt->setFetchMode(\PDO::FETCH_ASSOC);
         $collection = $mapper->collection($entityClass, $stmt, $query->with());
         // Ensure statement is closed
         $stmt->closeCursor();
         return $collection;
     } else {
         $mapper->addError(__METHOD__ . " - Unable to execute query " . implode(' | ', $this->connection()->errorInfo()));
         return array();
     }
 }
All Usage Examples Of Spot\Query::entityName