Comments (6)
Well i really like this idea, we could even for example create like Entity class without any extends or something which would have all necessary methods, and extend it both in our model class and row class, so we could still have all needed methods(though this could be achieved already therotically with magic __call
.
from phalcon.
I've had a go at adding this functionality - it's my first time using Zephir but I was able to test this and it seems to be working as outlined above.
I added get/set methods for the Resultset Row Class.
from phalcon.
I just saw the announcement about 3.4.2 being the last release for 3.x. My code above was based on the 3.4.x branch of Phalcon, so I guess it might be in the wrong place! Please advise if this needs to be refactored on the 4.0.x branch instead, and if you'd like this submitted as a pull request?
from phalcon.
I think we should consider this more to have better compability with php 7.2 features, what i mean:
interface Xyz
{
public function getName();
}
class RowXyz extends Phalcon\Mvc\Mode\Row implements Xyz
{
public $name;
public function getName()
{
return $this->name;
}
}
class ModelXyz extends Phalcon\Mvc\Model implements Xyz
{
protected $name;
public function getName()
{
return $this->name;
}
}
And then somewhere we could have code like:
class XyzRepository
{
public function findByParams(array $params) : ?Xyz
{
// we create somewhere $arrayParams which can have or not columns property
return ModelXyz::findFirst($arrayParams);
}
}
Also i would even vote for adding posibility that it doesn't needs to extend Row object, it's already simple object just having some additional methods, maybe just implementing some interface could be enough.
from phalcon.
I was hoping to re-open this if that's OK with everyone π
from phalcon.
It's open. I removed the stale tag (bot)
from phalcon.
Related Issues (20)
- [NFR]: Replace regexp in the router with arrays for extra performance
- Can't access page, 404 FORBIDDEN
- Can I use `$this->getRelated` on already cached data?
- [BUG]: Scrutinizer Fixes HOT 1
- [NFR]: ADD sticky for read write connection
- [NFR]: removeBehavior method in Model
- [NFR]:returnedValue not updated after dispatcher->forward
- [NFR]: No way to add html attributes to Select Tag. documentation inadequate HOT 1
- [BUG]: The "setDefault" method does not work for forms of type "text" with name "value" HOT 5
- update src folder links
- How to use cookie in phalcon 4.x ? HOT 1
- update tests folder links
- [NFR]: Complete rework of ORM HOT 3
- [BUG]: \Phalcon\Encryption\Crypt + named parameters/arguments throw fatal error. HOT 1
- [NFR]: Refactor Phalcon\Mvc\Router/Route HOT 1
- [NFR]: Refactor Phalcon\Mvc\Model\MetaData
- phalcon 3,4 webhook problem HOT 2
- [NFR]: What is the purpose of this libraryοΌ HOT 3
- [NFR]: Add a getResult() or fetchAll() method to Resultset\Simple
- [BUG]: when i use JWT Builder , api returns blank HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phalcon.