Ejemplo n.º 1
0
 /**
  * Sets the alias for this table
  * @param string $alias Alias for this table
  * @param zibo\library\orm\model\ModelMeta $meta Meta of the model of the query, to check if the alias is not a field name
  * @return null
  */
 private function setAlias($alias, ModelMeta $meta = null)
 {
     if (String::isEmpty($alias)) {
         throw new OrmException('Provided alias is empty');
     }
     if ($meta && $meta->hasField($alias)) {
         throw new OrmException('Provided alias is a field name of model ' . $meta->getName());
     }
     $this->alias = $alias;
 }