S
S
sl1m_dogg2014-10-02 14:41:30
PHP
sl1m_dogg, 2014-10-02 14:41:30

Has anyone used DTO+DAO in php?

Actually, they asked me to work with Mysql according to this scheme, I am familiar with DAO, but I haven’t touched DTO yet, what should be there in general?
UPD: phpdao framework

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Push Pull, 2014-10-02
@sl1m_dogg

DTO - data transfer object, you could even take the info from the wiki.
DTO does not contain behavior, but contains state, so it can be safely passed both within application modules and between separate application instances.
A very simple example is a class object without methods.
More complex contains __contstruct, __toString, or toJson or toXML, these methods are required in a distributed application

class User {
    public $username;
    public $login;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question