Git Product home page Git Product logo

Comments (4)

tchoulom avatar tchoulom commented on August 10, 2024 1

Why are you implementing the "setPage" and "getPage" functions? These functions are already implemented in the bundle https://github.com/tchoulom/ViewCounterBundle/blob/master/Entity/ViewCounter.php:

public function setPage(ViewCountable $page): self
{
     $property = $this->getProperty();
     $setPage = 'set' . ucfirst($property);
     $this->$setPage($page);

     return $this;
 }

Be careful, this function depends on the variable "$property" ($property = $this->getProperty();) which you seem not to take into account in your entity:

public function setPage(ViewCountable $page): ViewCounter
{
     $this->entry = $page;

     return $this;
}

from viewcounterbundle.

tchoulom avatar tchoulom commented on August 10, 2024

What version of "ViewCounterBundle" are you using?

from viewcounterbundle.

melroy89 avatar melroy89 commented on August 10, 2024

v6.1.0 (https://github.com/MbinOrg/mbin/blob/main/composer.lock), sorry I didn't mentioned the project indeed: https://github.com/MbinOrg/mbin

from viewcounterbundle.

melroy89 avatar melroy89 commented on August 10, 2024

Why are you implementing the "setPage" and "getPage" functions?

Uh.. let's call it legacy reasons... 😖

I'm glad to fix up the code and remove those methods if there is no need to implement them in the first place! So let's see what happens if I just remove the methods completely in this child class.

from viewcounterbundle.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.