phalcon / cphalcon

High performance, full-stack PHP framework delivered as a C extension.
https://phalcon.io
BSD 3-Clause "New" or "Revised" License
10.79k stars 1.96k forks source link

Issues in implementing CollectionInterface #11206

Closed khalidumarr closed 8 years ago

khalidumarr commented 8 years ago

HI all, i want to extend functionality of find method in phalcon collection class so i am implementing CollectionInterface in my own collection class, but unfortunately i am having an issue while making it work with empty declared functions. My script just stops execution without any notice or error. I have looked into zephir code and tried to translate it manually. I also confirmed the version i am using and the code i am viewing on github is same.

please help me what am i missing while implementing CollectionInterface.

<?php
class BCollection implements Phalcon\Mvc\CollectionInterface{   
    public function setId($id){}

    public function getId(){}

    public function getReservedAttributes(){}

    public function getSource(){}

    public function setConnectionService($connectionService){}

    public function getConnection(){}

    public static function cloneResult(\Phalcon\Mvc\CollectionInterface $collection, $document){}

    public function fireEvent($eventName){}

    public function fireEventCancel($eventName){}

    public function validationHasFailed(){}

    public function getMessages(){}

    public function appendMessage(\Phalcon\Mvc\Model\MessageInterface $message){}

    public function save(){}

    public static function findById($id){}

    public static function findFirst($parameters = null){}

    public static function find($parameters = null){}

    public static function count($parameters = null){}

    public function delete(){}
}
andresgutierrez commented 8 years ago

What problem are you having? An error is being shown or something?

khalidumarr commented 8 years ago

i am unable to implement collectionInterface. if you just copy above code and try to run, you can re-produce the issue. and no, i am not receiving any error message my script just halts execution.