Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

[WIP] added phpcr introduction chapter #273

Merged
merged 1 commit into from
Oct 16, 2013
Merged

[WIP] added phpcr introduction chapter #273

merged 1 commit into from
Oct 16, 2013

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Sep 28, 2013

Q A
Doc fix? No
New docs? Yes
Applies to All
Fixed tickets #242

Very minor starting point, just so I can work on this on github.


</doctrine-mapping>

After this, you have to create getters and setters for the properties.
Copy link
Member Author

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?

Copy link
Member

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

Copy link
Member Author

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 :)

Copy link
Member

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 ;-)

Copy link
Member Author

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 :)

Copy link
Member

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

@wouterj
Copy link
Member Author

wouterj commented Oct 6, 2013

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
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to 'many'

@wouterj
Copy link
Member Author

wouterj commented Oct 7, 2013

@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.
Copy link
Member

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 :)

Copy link
Member Author

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

@lsmith77
Copy link
Member

lsmith77 commented Oct 8, 2013

Warning, treated as error:
/home/travis/build/symfony-cmf/symfony-cmf-docs/book/database_layer.rst:104: WARNING: Definition list ends without a blank line; unexpected unindent.

@wouterj
Copy link
Member Author

wouterj commented Oct 8, 2013

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.

Copy link
Member

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)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Member Author

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.

Copy link
Member

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
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo.. :(

@wouterj
Copy link
Member Author

wouterj commented Oct 13, 2013

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,
Copy link
Member

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;
Copy link
Member

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?

Copy link
Member

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

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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.

@dbu
Copy link
Member

dbu commented Oct 15, 2013

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinking > thinking

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Member

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!

@dbu
Copy link
Member

dbu commented Oct 16, 2013

@wouterj can you clean this one up and merge? its only tiny details left...

wouterj added a commit that referenced this pull request Oct 16, 2013
[WIP] added phpcr introduction chapter
@wouterj wouterj merged commit bcd029f into master Oct 16, 2013
@wouterj wouterj deleted the issue_242 branch October 16, 2013 14:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants