PHP Classes

Countable

Recommend this page to a friend!

      Cached Virtual Array  >  All threads  >  Countable  >  (Un) Subscribe thread alerts  
Subject:Countable
Summary:Missed Implement Countable
Messages:4
Author:Johnny
Date:2011-08-02 03:09:00
Update:2011-08-03 02:53:33
 

  1. Countable   Reply   Report abuse  
Picture of Johnny Johnny - 2011-08-02 03:09:00
Would be perfect if add implement Countable

  2. Re: Countable   Reply   Report abuse  
Picture of Ingvar Stepanyan Ingvar Stepanyan - 2011-08-02 13:36:36 - In reply to message 1 from Johnny
Thank you for interest. Countable was firstly planned for implementation but later was decided that anyway child class should implement own method to return count of elements, so there is no need to make wrapper in this abstract class. You may implement it yourself enough simply in your child class:

class MyArray extends CachedArray implements Countable
{
// ... your real methods to override abstracts ...

function count() { return $whatever_you_want; }
}

  3. Re: Countable   Reply   Report abuse  
Picture of Ingvar Stepanyan Ingvar Stepanyan - 2011-08-02 13:37:29 - In reply to message 1 from Johnny
Thank you for interest. Countable was firstly planned for implementation but later was decided that anyway child class should implement own method to return count of elements, so there is no need to make wrapper in this abstract class. You may implement it yourself enough simply in your child class:

class MyArray extends CachedArray implements Countable
{
// ... your real methods to override abstracts ...

function count() { return $whatever_you_want; }
}

  4. Re: Countable   Reply   Report abuse  
Picture of Johnny Johnny - 2011-08-03 02:53:33 - In reply to message 3 from Ingvar Stepanyan
Yeah. I have done exactly the same way as you suggested.