Conversation
|
this could actually be a generic Doctrine |
|
While the classes seem similar, I think the way the Managers store files are too different e.g. this one requires a stream_get_contents call on the getContent() method, while Mongo just returns the getBytes() method. And ORM (blob) is a different story completely (if one were to be built). |
|
but wouldn't the difference be the responsibility of the given |
|
we could also define an interface which adds methods like |
|
@lsmith77 the interface sounds like a bad idea, as it makes ImagineBundle a requirement rather than optional for any library implementing the interface. The image class I'm using, for example, comes directly from the SymfonyCMF CreateBundle. I could extend the image class and configure CreateBundle to use that, but it doesn't make things much easier for the end user... I agree though that the current implementation is rather weak. Even for the GridFS one. Using the "getBytes" method is merely the suggestion from the docs, but by no means is a "getBytes" method something you can assume. The same goes for the "getContent" method used in this PR... This could be solved by using the Symfony 2.2+ PropertyAccess component and making the method to be used configurable. |
|
so yeah .. its a "duct typing" interface anyway .. so i think we can then just assume that users that want to use this loader also implement a however to make it easier to handle differences, it might be good to move the fetching of the stream to a protected method. that way people could override this class and simply adjust that single method to use |
|
hmm i guess there is another issue that ORM users as well as users of another ODM need to figure out and that is the translation of the "id" into something they can use. I guess for PHPCR ODM it would make sense to support the so i guess maybe we should provide an abstract base class that support |
|
i will take care of the refactoring myself ASAP |
|
done in 41a6308 |
No description provided.