Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved Model methods save(), create(), update(), delete(), and refresh() to Models Manager #13022

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
207659c
Moved Model::delete() to Models Manager.
SidRoberts Aug 18, 2017
ecbb703
Moved Model::create() and Model::update() to Models Manager.
SidRoberts Aug 18, 2017
7eebe7c
Moved Model::save() to Models Manager.
SidRoberts Aug 18, 2017
e33e50e
Moved Model::refresh() to Models Manager.
SidRoberts Aug 19, 2017
b3c39a1
Moved Model::exists() to Models Manager.
SidRoberts Aug 19, 2017
fa7496e
Added Model Repository class.
SidRoberts Aug 20, 2017
b7460a7
Moved Model::find() and Model::findFirst() to Model Repository.
SidRoberts Aug 20, 2017
042a5cb
Updated references for find() and findFirst().
SidRoberts Aug 20, 2017
99b9c76
Moved Model::count(), Model::minimum(), Model::maximum(), Model::aver…
SidRoberts Aug 21, 2017
ab3102c
Updated references to Model::count(), average(), sum(), minimum, maxi…
SidRoberts Aug 21, 2017
46c5eaa
Removed Model::sum(), maximum(), minimum().
SidRoberts Aug 21, 2017
cd87f84
Removed Model::query() to Models Repository.
SidRoberts Aug 21, 2017
cc2b53a
Moved invoke finder to Model Repository.
SidRoberts Aug 22, 2017
a6447ce
Removed namespace aliases for Models.
SidRoberts Aug 22, 2017
861ce32
Model unit tests now use ::class constant.
SidRoberts Aug 22, 2017
d7a3469
You can no longer assign data to models in the constructor.
SidRoberts Aug 22, 2017
a1c8ce5
Cleaned up Model::hasSnapshotData()
SidRoberts Aug 24, 2017
b3a7df9
Removed Model::cloneResult().
SidRoberts Aug 24, 2017
a97c104
Refactor.
SidRoberts Aug 24, 2017
74757ff
Fixed indentation.
SidRoberts Aug 24, 2017
d10b7d1
Added custom Model Repositories.
SidRoberts Aug 25, 2017
966fdab
Moved model relations to Model Repository.
SidRoberts Aug 25, 2017
8e70c54
You can no longer overwrite Model::getSource().
SidRoberts Aug 25, 2017
583f3d3
Moved Model::useDynamicUpdate() to Models Repository.
SidRoberts Aug 26, 2017
43d1272
Moved `Model::{get,set}Source()` and `Model::{get,set}Schema()` to Mo…
SidRoberts Aug 26, 2017
ed9c235
Moved column maps to Model Repository.
SidRoberts Aug 26, 2017
cd439cc
Moved `Model::{get,set}{Read,Write,}ConnectionService()` to Models Re…
SidRoberts Aug 26, 2017
64da347
Removed relation methods from Model.
SidRoberts Aug 27, 2017
8627600
Simplified Model::cloneResultsetMapHydrate()
SidRoberts Aug 27, 2017
9eec2cb
Removed count(), find() and findFirst() from ModelInterface
SidRoberts Aug 27, 2017
820176e
Removed findFirst(), find() and count() from Model
SidRoberts Aug 27, 2017
fc844ef
Consolidated Model::_postSave().
SidRoberts Aug 27, 2017
9103eb1
Refactored ModelRepository::__call().
SidRoberts Aug 27, 2017
91d24ac
Tidied up parameter/return types in Model Repository.
SidRoberts Aug 27, 2017
5e03ff9
Removed ModelManager::getLastInitialized().
SidRoberts Aug 27, 2017
a657abb
Refactored ModelManager::isVisibleModelProperty().
SidRoberts Aug 27, 2017
8c5a9d1
Refactored ModelManager::add{HasOne,BelongsTo,HasMany,HasManyToMany}()
SidRoberts Aug 27, 2017
562f4b3
Commands within Repository::initialize() are now chainable.
SidRoberts Aug 27, 2017
817746d
Added ModelManager::_addRelationship().
SidRoberts Aug 27, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,25 @@
- Change catch Exception to Throwable [#12288](https://github.com/phalcon/cphalcon/issues/12288)
- Removed deprecated methods (`Cli\Console::addModules()`, `Debug::getMajorVersion()`, `Http\Request::isSoapRequested()`, `Http\Request::isSecureRequest()`, `Mvc\Model\Criteria::addWhere()`, `Mvc\Model\Criteria::order()`, `Validation\Validator::isSetOption()`, `Security::hasLibreSsl()`, `Security::getSslVersionNumber()`).
- Renamed `Http\RequestInterface::isSoapRequested()` to `isSoap()` and `Http\RequestInterface::isSecureRequest()` to `isSecure()`.
- Moved `Model::save()`, `Model::create()`, `Model::update()` and `Model::delete()` to Models Manager.
- Moved `Model::refresh()` to Models Manager.
- Added `ModelInterface::isSkipped()`.
- Added `ModelInterface::clearMessages()`.
- Added `ModelInterface::cancelOperation()` (was previously protected in Model).
- Added `ModelInterface::setOperationMade()`.
- Added `ModelInterface::exists()` (was previously protected in Model).
- Added `ModelInterface::updateSnapshot()`, `ModelInterface::{get,set}UniqueKey()`, `ModelInterface::{get,set}UniqueParams()`, `ModelInterface::{get,set}UniqueTypes()`, `ModelInterface::resetUniqueParams()`.
- Moved `Model::exists()` to Models Manager.
- Moved `Model::find()` and `Model::findFirst()` to Model Repository.
- Moved `Model::count()`, `Model::minimum()`, `Model::maximum()`, `Model::average()`, `Model::sum()` to Models Repository.
- Moved `Model::query()` to Model Repository.
- Removed Model namespace aliases.
- You can no longer assign data to models in the constructor.
- Removed `Model::cloneResult()`.
- Added custom Model Repositories.
- You can no longer overwrite `Model::getSource()`.
- Moved `Model::useDynamicUpdate()` to Models Repository.
- Moved `Model::{get,set}Source()` and `Model::{get,set}Schema()` to Models Repository.
- Moved column maps to Model Repository.
- Moved `Model::{get,set}{Read,Write,}ConnectionService()` to Models Repository.
- Removed `ModelManager::getLastInitialized()`.
4 changes: 3 additions & 1 deletion phalcon/cache/frontend/data.zep
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ use Phalcon\Cache\FrontendInterface;
* use Phalcon\Cache\Backend\File;
* use Phalcon\Cache\Frontend\Data;
*
* $robotsRepository = $modelsManager->getRepository(Robots::class);
*
* // Cache the files for 2 days using a Data frontend
* $frontCache = new Data(
* [
Expand All @@ -55,7 +57,7 @@ use Phalcon\Cache\FrontendInterface;
* if ($robots === null) {
* // $robots is null due to cache expiration or data does not exist
* // Make the database call and populate the variable
* $robots = Robots::find(
* $robots = $robotsRepository->find(
* [
* "order" => "id",
* ]
Expand Down
4 changes: 3 additions & 1 deletion phalcon/cache/frontend/igbinary.zep
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ use Phalcon\Cache\FrontendInterface;
* Allows to cache native PHP data in a serialized form using igbinary extension
*
*<code>
* $robotsRepository = $modelsManager->getRepository(Robots::class);
*
* // Cache the files for 2 days using Igbinary frontend
* $frontCache = new \Phalcon\Cache\Frontend\Igbinary(
* [
Expand All @@ -54,7 +56,7 @@ use Phalcon\Cache\FrontendInterface;
* if ($robots === null) {
* // $robots is null due to cache expiration or data do not exist
* // Make the database call and populate the variable
* $robots = Robots::find(
* $robots = $robotsRepository->find(
* [
* "order" => "id",
* ]
Expand Down
4 changes: 3 additions & 1 deletion phalcon/cache/frontend/msgpack.zep
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ use Phalcon\Cache\Exception;
* use Phalcon\Cache\Backend\File;
* use Phalcon\Cache\Frontend\Msgpack;
*
* $robotsRepository = $modelsManager->getRepository(Robots::class);
*
* // Cache the files for 2 days using Msgpack frontend
* $frontCache = new Msgpack(
* [
Expand All @@ -59,7 +61,7 @@ use Phalcon\Cache\Exception;
* if ($robots === null) {
* // $robots is null due to cache expiration or data do not exist
* // Make the database call and populate the variable
* $robots = Robots::find(
* $robots = $robotsRepository->find(
* [
* "order" => "id",
* ]
Expand Down
3 changes: 2 additions & 1 deletion phalcon/cache/frontend/none.zep
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use Phalcon\Cache\FrontendInterface;
*
*<code>
*<?php
* $robotsRepository = $modelsManager->getRepository(Robots::class);
*
* //Create a None Cache
* $frontCache = new \Phalcon\Cache\Frontend\None();
Expand All @@ -50,7 +51,7 @@ use Phalcon\Cache\FrontendInterface;
* if ($robots === null) {
* // This cache doesn't perform any expiration checking, so the data is always expired
* // Make the database call and populate the variable
* $robots = Robots::find(
* $robots = $robotsRepository->find(
* [
* "order" => "id",
* ]
Expand Down
2 changes: 1 addition & 1 deletion phalcon/db/rawvalue.zep
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Phalcon\Db;
* $subscriber->email = "[email protected]";
* $subscriber->createdAt = new \Phalcon\Db\RawValue("now()");
*
* $subscriber->save();
* $modelsManager->save($subscriber);
*</code>
*/
class RawValue
Expand Down
Loading