-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
|
||
/** | ||
* This file is part of the Phalcon Framework. | ||
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
* | ||
* Implementation of this file has been influenced by AtlasPHP | ||
* | ||
* @link https://github.com/atlasphp/Atlas.Query | ||
* @license https://github.com/atlasphp/Atlas.Qyert/blob/1.x/LICENSE.md | ||
*/ | ||
|
||
namespace Phalcon\DataMapper\Query; | ||
|
||
use Phalcon\DataMapper\Pdo\Connection; | ||
|
||
/** | ||
* Class QueryFactory | ||
* | ||
* @property string $class | ||
*/ | ||
class QueryFactory | ||
{ | ||
/** | ||
* Create a new Bind object | ||
* | ||
* @return Bind | ||
*/ | ||
public function newBind() -> <Bind> | ||
{ | ||
return new Bind(); | ||
} | ||
|
||
/** | ||
* Create a new Delete object | ||
* | ||
* @param Connection $connection | ||
* | ||
* @return Delete | ||
*/ | ||
public function newDelete(<Connection> connection) -> <Delete> | ||
{ | ||
return new Delete(connection, this->newBind()); | ||
} | ||
|
||
/** | ||
* Create a new Insert object | ||
* | ||
* @param Connection $connection | ||
* | ||
* @return Insert | ||
*/ | ||
public function newInsert(<Connection> connection) -> <Insert> | ||
{ | ||
return new Insert(connection, this->newBind()); | ||
} | ||
|
||
/** | ||
* Create a new Select object | ||
* | ||
* @param Connection $connection | ||
* | ||
* @return Select | ||
*/ | ||
public function newSelect(<Connection> connection) -> <Select> | ||
{ | ||
return new Select(connection, this->newBind()); | ||
} | ||
|
||
/** | ||
* Create a new Update object | ||
* | ||
* @param Connection $connection | ||
* | ||
* @return Update | ||
*/ | ||
public function newUpdate(<Connection> connection) -> <Update> | ||
{ | ||
return new Update(connection, this->newBind()); | ||
} | ||
} |