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

View, table getter #10216

Merged
merged 2 commits into from Feb 14, 2017
Merged

View, table getter #10216

merged 2 commits into from Feb 14, 2017

Conversation

ADmad
Copy link
Member

@ADmad ADmad commented Feb 14, 2017

  • Added Helper::getView() to avoid having to use $this->_View in helpers. This was specially annoying as one had to remember that casing of _View is not consistent with other lower case names.
  • Added Behavior::getTable(). Is the method name fine or should be use something more generic like getModel()?

Component::getController() already exits.

@ADmad ADmad added this to the 3.4.1 milestone Feb 14, 2017
@ADmad ADmad changed the title View table getter View, table getter Feb 14, 2017
@codecov-io
Copy link

codecov-io commented Feb 14, 2017

Codecov Report

Merging #10216 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##             master   #10216      +/-   ##
============================================
+ Coverage      94.9%   94.91%   +0.01%     
- Complexity    12072    12074       +2     
============================================
  Files           420      420              
  Lines         29952    29956       +4     
============================================
+ Hits          28425    28433       +8     
+ Misses         1527     1523       -4
Impacted Files Coverage Δ Complexity Δ
src/View/Helper.php 100% <100%> (ø) 17 <1> (+1)
src/ORM/Behavior.php 96.55% <100%> (+0.08%) 33 <1> (+1)
src/Cache/Engine/FileEngine.php 86.66% <ø> (+1.11%) 73% <ø> (ø)
src/Cache/CacheEngine.php 93.47% <ø> (+2.17%) 19% <ø> (ø)
src/Cache/CacheRegistry.php 100% <ø> (+4.16%) 11% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 423489e...6fde985. Read the comment docs.

Copy link
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@antograssiot
Copy link
Contributor

Good idea

@dereuromark
Copy link
Member

dereuromark commented Feb 14, 2017

If the behavior wasn't

public function __construct(Table $table, array $config = [])

but

public function __construct(RepositoryInterface $model, array $config = [])

I would also go for getModel()

But since it isn't in 3.x, getTable() sounds good to me 👍

@ADmad ADmad merged commit a327e83 into cakephp:master Feb 14, 2017
@ADmad ADmad deleted the view-table-getter branch February 14, 2017 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants