-
Notifications
You must be signed in to change notification settings - Fork 156
[WIP] added phpcr introduction chapter #273
Conversation
|
||
</doctrine-mapping> | ||
|
||
After this, you have to create getters and setters for the properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I correct that there is no doctrine:phpcr:generate:entity
command for PHPCR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately yes. i would love to have it. we might reuse most of the orm code for that, depending on how well they did it... but not for 1.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not for 1.0? If you really want it, I have 1 hour today and 3 hours tomorrow to work on it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we said we don't want to merge any non-critical things into the code anymore this week, to increase the chances that 1.0 does not have new bugs introduced... there are still many parts of the doc not written if you have some time you want to invest ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I already planned to invest time into the docs :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DoctrinePHPCRBundle is already released as 1.0
but feel free to work on it now and we can open a 1.0 branch and merge this into master
I putted some time into this one |
============================= | ||
|
||
The Symfony CMF is storage layer agnostic, meaning that it can work with all | ||
sorts of storage layers. By default, the Symfony CMF works with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is "with all sorts of" good english for this use case? i feel its strange here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to 'many'
@dbu thanks for your review, I've fixed them and added some more information. Tomorrow, I'll finish the article. |
|
||
The Symfony CMF is storage layer agnostic, meaning that it can work with many | ||
storage layers. By default, the Symfony CMF works with the `Doctrine PHPCR-ODM`_. | ||
In this chapter, you'll learn how to work with the Doctrine PHPCR-ODM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you will learn how to work ... a quick google doesn't turn up any reasons why, but I'm pretty sure its more correct :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you'll is the informal way of you will
|
I finished it with all basic information. After a good review, this is ready to get merged. After that, we may add sections about inheritance, repository classes, versioning and other great stuff. |
that holds data* - is simple and helps fulfill the business requirement of | ||
needing tasks in your application. This class can't be persisted to | ||
Doctrine PHPCR-ODM yet - it's just a simple PHP class. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being picky, I would say that this class isn't a document until it has been mapped. I.e. I wouldn't call this class a document (even though I suspect it might become one, as it is in the Document
namespace)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this paragraph could be rephrased to say more clearly: The class is a Model for your application. A model tracked by PHPCR-ODM is called a document.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, not sure about this one. It's a sentence used in both ORM and MongoDB ODM. I prefer to not change those standard sentences to much.
Also, I don't want to confuse starters with lots of words which all means somewhat the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well. "The class" should be "This class" imo. The paragraph doesn't really click with me. But lets not block it.
} | ||
|
||
To query for objects, you can use both the ``find`` and ``findAll`` methods of | ||
the document manager and all helper methods of a class-specific repository. In |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the DocumentManager has no findAll method, by the way. only find and findMany where you specify one resp. several ids.
repository findAll is not a good idea in general so we should not mention this in the intro imho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo.. :(
I think I've fixed all related comments. Unless someone adds new comments, it can be merged. |
.. sidebar:: PHPCR Implementations | ||
|
||
In order to let the Doctrine PHPCR-ODM communicate with the PHPCR, a PHPCR | ||
implentation is needed. `Jackalope`_ is a famous PHPCR implementation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo implentation
also
a famous
-> the reference
// src/Acme/TaskBundle/Document/Task.php | ||
namespace Acme\TaskBundle\Document; | ||
|
||
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i tend to use PHPCRODM as alias. what do others think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCRODM is a bit long for me .. i prefer PHPCR or ODM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should check if the doc is consistent and promote one way to do this in our slides and examples (and i will even update my projects to train my brain on the consistent way...). PHPCR or ODM? i think PHPCR is more immediately clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then again, it promotes the confusion between the PHPCR and PHPCR-ODM - not sure how critical that is for people to distinguish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the ORM uses ORM, MongoDB ODM uses MongoDB, so I think we should use PHPCR for the PHPCR ODM.
looks good to me. there are a few unanswered comments from dantleech above, can you please check them? |
Creating a Document Class | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Without tinking about Doctrine or PHPCR-ODM, you can create a ``Task`` object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tinking > thinking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
once you pushed this, feel free to merge wouter. thanks!
@wouterj can you clean this one up and merge? its only tiny details left... |
[WIP] added phpcr introduction chapter
Very minor starting point, just so I can work on this on github.