Skip to content

Commit

Permalink
Revert "[#14213] - Refactored Db/Mvc abstract classes"
Browse files Browse the repository at this point in the history
This reverts commit a4ff07c.
  • Loading branch information
niden committed Jul 4, 2019
1 parent 4cccb8e commit 955e408
Show file tree
Hide file tree
Showing 29 changed files with 133 additions and 129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
* file that was distributed with this source code.
*/

namespace Phalcon\Db\Dialect;

use Phalcon\Db\Exception;
use Phalcon\Db\ColumnInterface;
namespace Phalcon\Db;

/**
* This is the base class to each database dialect. This implements
* common methods to transform intermediate code into its RDBMS related syntax
*/
abstract class AbstractDialect implements DialectInterface
abstract class Dialect implements DialectInterface
{
protected escapeChar;

Expand Down
6 changes: 3 additions & 3 deletions phalcon/Db/Dialect/Mysql.zep
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@

namespace Phalcon\Db\Dialect;

use Phalcon\Db\Dialect\AbstractDialect;
use Phalcon\Db\Dialect;
use Phalcon\Db\Column;
use Phalcon\Db\Exception;
use Phalcon\Db\IndexInterface;
use Phalcon\Db\ColumnInterface;
use Phalcon\Db\ReferenceInterface;
use Phalcon\Db\Dialect\DialectInterface;
use Phalcon\Db\DialectInterface;

/**
* Generates database specific SQL for the MySQL RDBMS
*/
class Mysql extends AbstractDialect
class Mysql extends Dialect
{
/**
* @var string
Expand Down
8 changes: 4 additions & 4 deletions phalcon/Db/Dialect/Postgresql.zep
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@

namespace Phalcon\Db\Dialect;

use Phalcon\Db\Dialect;
use Phalcon\Db\Column;
use Phalcon\Db\ColumnInterface;
use Phalcon\Db\Dialect\AbstractDialect;
use Phalcon\Db\Dialect\DialectInterface;
use Phalcon\Db\Exception;
use Phalcon\Db\IndexInterface;
use Phalcon\Db\ColumnInterface;
use Phalcon\Db\ReferenceInterface;
use Phalcon\Db\DialectInterface;

/**
* Generates database specific SQL for the PostgreSQL RDBMS
*/
class Postgresql extends AbstractDialect
class Postgresql extends Dialect
{
/**
* @var string
Expand Down
6 changes: 3 additions & 3 deletions phalcon/Db/Dialect/Sqlite.zep
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ namespace Phalcon\Db\Dialect;
use Phalcon\Db\Column;
use Phalcon\Db\Exception;
use Phalcon\Db\IndexInterface;
use Phalcon\Db\Dialect\AbstractDialect;
use Phalcon\Db\Dialect\DialectInterface;
use Phalcon\Db\Dialect;
use Phalcon\Db\DialectInterface;
use Phalcon\Db\ColumnInterface;
use Phalcon\Db\ReferenceInterface;

/**
* Generates database specific SQL for the SQLite RDBMS
*/
class Sqlite extends AbstractDialect
class Sqlite extends Dialect
{
/**
* @var string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

namespace Phalcon\Db\Dialect;
namespace Phalcon\Db;

use Phalcon\Db\ColumnInterface;
use Phalcon\Db\ReferenceInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
* file that was distributed with this source code.
*/

namespace Phalcon\Mvc\Controller;
namespace Phalcon\Mvc;

use Phalcon\Di\Injectable;

/**
* Phalcon\Mvc\Controller
*
* Every application controller should extend this class that encapsulates all
* the controller functionality
*
Expand All @@ -24,7 +26,7 @@ use Phalcon\Di\Injectable;
*```php
* <?php
*
* class PeopleController extends \Phalcon\Mvc\Controller\AbstractController
* class PeopleController extends \Phalcon\Mvc\Controller
* {
* // This action will be executed by default
* public function indexAction()
Expand All @@ -50,10 +52,10 @@ use Phalcon\Di\Injectable;
* }
*```
*/
abstract class AbstractController extends Injectable implements ControllerInterface
abstract class Controller extends Injectable implements ControllerInterface
{
/**
* Phalcon\Mvc\Controller\AbstractController constructor
* Phalcon\Mvc\Controller constructor
*/
final public function __construct()
{
Expand Down
4 changes: 3 additions & 1 deletion phalcon/Mvc/Controller/BindModelInterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
namespace Phalcon\Mvc\Controller;

/**
*Interface for Phalcon\Mvc\Controller\BindModel
* Phalcon\Mvc\Controller\BindModelInterface
*
* Interface for Phalcon\Mvc\Controller
*/
interface BindModelInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
* file that was distributed with this source code.
*/

namespace Phalcon\Mvc\Controller;
namespace Phalcon\Mvc;

/**
* Phalcon\Mvc\ControllerInterface
*
* Interface for controller handlers
*/
interface ControllerInterface
Expand Down
2 changes: 1 addition & 1 deletion phalcon/Mvc/Dispatcher.zep
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use Phalcon\Mvc\DispatcherInterface;
use Phalcon\Mvc\Dispatcher\Exception;
use Phalcon\Events\ManagerInterface;
use Phalcon\Http\ResponseInterface;
use Phalcon\Mvc\Controller\ControllerInterface;
use Phalcon\Mvc\ControllerInterface;
use Phalcon\Dispatcher\AbstractDispatcher as BaseDispatcher;

/**
Expand Down
2 changes: 1 addition & 1 deletion phalcon/Mvc/DispatcherInterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Phalcon\Mvc;

use Phalcon\Mvc\Controller\ControllerInterface;
use Phalcon\Mvc\ControllerInterface;
use Phalcon\Dispatcher\DispatcherInterface as DispatcherInterfaceBase;

/**
Expand Down
4 changes: 2 additions & 2 deletions phalcon/Mvc/Micro.zep
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use ArrayAccess;
use Closure;
use Phalcon\DiInterface;
use Phalcon\Di\Injectable;
use Phalcon\Mvc\Controller\AbstractController;
use Phalcon\Mvc\Controller;
use Phalcon\Di\FactoryDefault;
use Phalcon\Mvc\Micro\Exception;
use Phalcon\Di\ServiceInterface;
Expand Down Expand Up @@ -474,7 +474,7 @@ class Micro extends Injectable implements ArrayAccess
if typeof handler == "array" {
let realHandler = handler[0];

if realHandler instanceof AbstractController && modelBinder != null {
if realHandler instanceof Controller && modelBinder != null {
let methodName = handler[1];
let bindCacheKey = "_PHMB_" . get_class(realHandler) . "_" . methodName;

Expand Down
6 changes: 3 additions & 3 deletions phalcon/Mvc/Model.zep
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Phalcon\Mvc;
use JsonSerializable;
use Phalcon\Db\Adapter\AdapterInterface;
use Phalcon\Db\Column;
use Phalcon\Db\Dialect\DialectInterface;
use Phalcon\Db\DialectInterface;
use Phalcon\Db\Enum;
use Phalcon\Db\RawValue;
use Phalcon\Di\InjectionAwareInterface;
Expand All @@ -22,12 +22,12 @@ use Phalcon\Events\ManagerInterface as EventsManagerInterface;
use Phalcon\Helper\Arr;
use Phalcon\Messages\Message;
use Phalcon\Messages\MessageInterface;
use Phalcon\Mvc\Model\Behavior\BehaviorInterface;
use Phalcon\Mvc\Model\BehaviorInterface;
use Phalcon\Mvc\Model\Criteria;
use Phalcon\Mvc\Model\CriteriaInterface;
use Phalcon\Mvc\Model\Exception;
use Phalcon\Mvc\Model\ManagerInterface;
use Phalcon\Mvc\Model\MetaData\MetaDataInterface;
use Phalcon\Mvc\Model\MetaDataInterface;
use Phalcon\Mvc\Model\Query;
use Phalcon\Mvc\Model\Query\Builder;
use Phalcon\Mvc\Model\Query\BuilderInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@
* file that was distributed with this source code.
*/

namespace Phalcon\Mvc\Model\Behavior;
namespace Phalcon\Mvc\Model;

use Phalcon\Mvc\ModelInterface;
use Phalcon\Mvc\Model\Behavior\BehaviorInterface;
use Phalcon\Mvc\Model\BehaviorInterface;

/**
* Phalcon\Mvc\Model\Behavior
*
* This is an optional base class for ORM behaviors
*/
abstract class AbstractBehavior implements BehaviorInterface
abstract class Behavior implements BehaviorInterface
{
/**
* @var array
Expand Down
4 changes: 2 additions & 2 deletions phalcon/Mvc/Model/Behavior/SoftDelete.zep
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Phalcon\Mvc\Model\Behavior;

use Phalcon\Mvc\ModelInterface;
use Phalcon\Mvc\Model\Behavior\AbstractBehavior;
use Phalcon\Mvc\Model\Behavior;
use Phalcon\Mvc\Model\Exception;

/**
Expand All @@ -20,7 +20,7 @@ use Phalcon\Mvc\Model\Exception;
* Instead of permanently delete a record it marks the record as deleted
* changing the value of a flag column
*/
class SoftDelete extends AbstractBehavior
class SoftDelete extends Behavior
{
/**
* Listens for notifications from the models manager
Expand Down
4 changes: 2 additions & 2 deletions phalcon/Mvc/Model/Behavior/Timestampable.zep
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Phalcon\Mvc\Model\Behavior;

use Closure;
use Phalcon\Mvc\ModelInterface;
use Phalcon\Mvc\Model\Behavior\AbstractBehavior;
use Phalcon\Mvc\Model\Behavior;
use Phalcon\Mvc\Model\Exception;

/**
Expand All @@ -21,7 +21,7 @@ use Phalcon\Mvc\Model\Exception;
* Allows to automatically update a model’s attribute saving the datetime when a
* record is created or updated
*/
class Timestampable extends AbstractBehavior
class Timestampable extends Behavior
{
/**
* Listens for notifications from the models manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
* file that was distributed with this source code.
*/

namespace Phalcon\Mvc\Model\Behavior;
namespace Phalcon\Mvc\Model;

use Phalcon\Mvc\ModelInterface;

/**
* Phalcon\Mvc\Model\BehaviorInterface
*
* Interface for Phalcon\Mvc\Model\Behavior
*/
interface BehaviorInterface
Expand Down
2 changes: 1 addition & 1 deletion phalcon/Mvc/Model/Manager.zep
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use Phalcon\Mvc\Model\Query;
use Phalcon\Mvc\Model\QueryInterface;
use Phalcon\Mvc\Model\Query\Builder;
use Phalcon\Mvc\Model\Query\BuilderInterface;
use Phalcon\Mvc\Model\Behavior\BehaviorInterface;
use Phalcon\Mvc\Model\BehaviorInterface;
use Phalcon\Events\ManagerInterface as EventsManagerInterface;

/**
Expand Down
2 changes: 1 addition & 1 deletion phalcon/Mvc/Model/ManagerInterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Phalcon\Mvc\Model;

use Phalcon\Db\Adapter\AdapterInterface;
use Phalcon\Mvc\ModelInterface;
use Phalcon\Mvc\Model\Behavior\BehaviorInterface;
use Phalcon\Mvc\Model\BehaviorInterface;
use Phalcon\Mvc\Model\RelationInterface;
use Phalcon\Mvc\Model\Query\BuilderInterface;
use Phalcon\Mvc\Model\QueryInterface;
Expand Down
Loading

0 comments on commit 955e408

Please sign in to comment.