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

Tidy Up Code #52

Open
1 of 3 tasks
TRPB opened this issue Dec 23, 2017 · 4 comments
Open
1 of 3 tasks

Tidy Up Code #52

TRPB opened this issue Dec 23, 2017 · 4 comments
Milestone

Comments

@TRPB
Copy link
Member

TRPB commented Dec 23, 2017

  • Switch to PSR-4 from classmap
  • Improve code quality score on scrutinizer by reducing complexity of most classes
  • Implement $fields property in DataSource\Database
@solleer
Copy link
Collaborator

solleer commented Dec 24, 2017

The fields property which is set on line 29 of DataSource\Database is never used

@solleer
Copy link
Collaborator

solleer commented Dec 24, 2017

Also what is the criteria parameter for in the One relation because I can't find an explanation for it

@TRPB
Copy link
Member Author

TRPB commented Dec 24, 2017

$fields is yet to be implemented. I want to make it so that instead of always using SELECT * it uses 'SELECT ' . implode(',' $fields) if it's set with the options of making some fields lazy loaded. For example, if you had a news website with articles where the text is LONGBLOB, in most cases you probably just want the title/author information, it's only on the article page that you'd want the entire article text. For this I'd want to be able to specify title, authorId in $fields and articleText in $lazyLoad

For $criteria in the One and Many relationships, it's so you can do something like this:

//Create a one-to-many relationship between authors and blogs, but only return blogs where deleted is set to 0
$authors->addRelation('blogs', new \Maphper\Relation\Many($blogs, 'id', 'authorId'), ['deleted' => 0]);

It allows you to specify additional rules for the relationship's WHERE clause

@tontof
Copy link
Contributor

tontof commented Dec 26, 2017

In order to be able to test only SQLite using --filter phpunit option, I was wondering if it could be possible to exact all tests in MySQL class test inside a trait file that is imported into both MySQL and SQLite files ?
That way, SqliteDatabaseTest won't extend anymore MySqlDatabaseTest.
I can do a PR if you think it's a good idea.

@solleer solleer added this to the Version 1.0 milestone Dec 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants