Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0] Drop namespace property from ClassMetadata #1812

Merged
merged 1 commit into from
Jul 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion UPGRADE-1.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ to a regular document:
/** @QueryResultDocument */
class UserPurchases
{
/** @ReferenceOne(targetDocument="User", name="_id") */
/** @ReferenceOne(targetDocument=User::class, name="_id") */
private $user;

/** @Field(type="int") */
Expand Down
2 changes: 1 addition & 1 deletion docs/en/cookbook/simple-search-engine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Now you can embed the ``Keyword`` document many times in the ``Product``:
{
// ...

/** @EmbedMany(targetDocument="Keyword") */
/** @EmbedMany(targetDocument=Keyword::class) */
private $keywords;

// ...
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/aggregation-builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ they can't be persisted to the database.
/** @QueryResultDocument */
class UserPurchases
{
/** @ReferenceOne(targetDocument="User", name="_id") */
/** @ReferenceOne(targetDocument=User::class, name="_id") */
private $user;

/** @Field(type="int") */
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/annotations-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ to be stored within an `@EmbedOne`_ or `@EmbedMany`_ relationship.
/** @Document(db="finance", collection="wallets") */
class Wallet
{
/** @EmbedOne(targetDocument="Money") */
/** @EmbedOne(targetDocument=Money::class) */
private $money;

public function setMoney(Money $money)
Expand Down
16 changes: 8 additions & 8 deletions docs/en/reference/bidirectional-references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and changes are tracked and persisted separately. Here is an example:
{
// ...

/** @ReferenceOne(targetDocument="User") */
/** @ReferenceOne(targetDocument=User::class) */
private $user;
}

Expand All @@ -23,7 +23,7 @@ and changes are tracked and persisted separately. Here is an example:
{
// ...

/** @ReferenceMany(targetDocument="BlogPost") */
/** @ReferenceMany(targetDocument=BlogPost::class) */
private $posts;
}

Expand Down Expand Up @@ -56,7 +56,7 @@ One to Many
{
// ...

/** @ReferenceOne(targetDocument="User", inversedBy="posts") */
/** @ReferenceOne(targetDocument=User::class, inversedBy="posts") */
private $user;
}

Expand All @@ -65,7 +65,7 @@ One to Many
{
// ...

/** @ReferenceMany(targetDocument="BlogPost", mappedBy="user") */
/** @ReferenceMany(targetDocument=BlogPost::class, mappedBy="user") */
private $posts;
}

Expand Down Expand Up @@ -136,7 +136,7 @@ Here is an example where we have a one to one relationship between ``Cart`` and
// ...

/**
* @ReferenceOne(targetDocument="Customer", inversedBy="cart")
* @ReferenceOne(targetDocument=Customer::class, inversedBy="cart")
*/
public $customer;
}
Expand All @@ -147,7 +147,7 @@ Here is an example where we have a one to one relationship between ``Cart`` and
// ...

/**
* @ReferenceOne(targetDocument="Cart", mappedBy="customer")
* @ReferenceOne(targetDocument=Cart::class, mappedBy="customer")
*/
public $cart;
}
Expand Down Expand Up @@ -192,12 +192,12 @@ Self-Referencing Many to Many
// ...

/**
* @ReferenceMany(targetDocument="User", mappedBy="myFriends")
* @ReferenceMany(targetDocument=User::class, mappedBy="myFriends")
*/
public $friendsWithMe;

/**
* @ReferenceMany(targetDocument="User", inversedBy="friendsWithMe")
* @ReferenceMany(targetDocument=User::class, inversedBy="friendsWithMe")
*/
public $myFriends;

Expand Down
12 changes: 6 additions & 6 deletions docs/en/reference/complex-references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ querying by the BlogPost's ID.
{
// ...

/** @ReferenceMany(targetDocument="Comment", mappedBy="blogPost") */
/** @ReferenceMany(targetDocument=Comment::class, mappedBy="blogPost") */
private $comments;

/**
* @ReferenceMany(
* targetDocument="Comment",
* targetDocument=Comment::class,
* mappedBy="blogPost",
* sort={"date"="desc"},
* limit=5
Expand All @@ -54,7 +54,7 @@ querying by the BlogPost's ID.
{
// ...

/** @ReferenceOne(targetDocument="BlogPost", inversedBy="comments") */
/** @ReferenceOne(targetDocument=BlogPost::class, inversedBy="comments") */
private $blogPost;
}

Expand All @@ -67,7 +67,7 @@ following example:

/**
* @ReferenceOne(
* targetDocument="Comment",
* targetDocument=Comment::class,
* mappedBy="blogPost",
* sort={"date"="desc"}
* )
Expand All @@ -87,7 +87,7 @@ administrators:

/**
* @ReferenceMany(
* targetDocument="Comment",
* targetDocument=Comment::class,
* mappedBy="blogPost",
* criteria={"isByAdmin" : true}
* )
Expand All @@ -106,7 +106,7 @@ call on the Comment repository class to populate the reference.

/**
* @ReferenceMany(
* targetDocument="Comment",
* targetDocument=Comment::class,
* mappedBy="blogPost",
* repositoryMethod="findSomeComments"
* )
Expand Down
6 changes: 3 additions & 3 deletions docs/en/reference/custom-collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ persistence-related features.
// ...

/**
* @EmbedMany(targetDocument="Section")
* @EmbedMany(targetDocument=Section::class)
*/
private $sections;

Expand Down Expand Up @@ -65,8 +65,8 @@ and ensuring that your custom class is initialized in the owning class' construc

/**
* @EmbedMany(
* collectionClass="SectionCollection"
* targetDocument="Section"
* collectionClass=SectionCollection::class
* targetDocument=Section::class
* )
*/
private $sections;
Expand Down
4 changes: 2 additions & 2 deletions docs/en/reference/embedded-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Embed a single document:
{
// ...

/** @EmbedOne(targetDocument="Address") */
/** @EmbedOne(targetDocument=Address::class) */
private $address;

// ...
Expand Down Expand Up @@ -64,7 +64,7 @@ Embed many documents:
{
// ...

/** @EmbedMany(targetDocument="Phonenumber") */
/** @EmbedMany(targetDocument=Phonenumber::class) */
private $phonenumbers = array();

// ...
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/geospatial-queries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ First, setup some documents like the following:
/** @Field(type="string") */
public $name;

/** @EmbedOne(targetDocument="Coordinates") */
/** @EmbedOne(targetDocument=Coordinates::class) */
public $coordinates;
}

Expand Down
4 changes: 2 additions & 2 deletions docs/en/reference/indexes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ Now if we had a ``BlogPost`` document with the ``Comment`` document embedded man
/** @Field(type="string") @Index */
private $slug;

/** @EmbedMany(targetDocument="Comment") */
/** @EmbedMany(targetDocument=Comment::class) */
private $comments;
}

Expand Down Expand Up @@ -308,7 +308,7 @@ options structures manually:
/** @Id */
public $id;

/** @EmbedOne(targetDocument="Coordinates") */
/** @EmbedOne(targetDocument=Coordinates::class) */
public $coordinates;
}

Expand Down
6 changes: 3 additions & 3 deletions docs/en/reference/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Here is a quick example of some PHP object documents that demonstrates a few of
/** @ODM\Field(type="date") */
private $left;

/** @ODM\EmbedOne(targetDocument="Address") */
/** @ODM\EmbedOne(targetDocument=Address::class) */
private $address;

public function getId(): ?string { return $this->id; }
Expand Down Expand Up @@ -82,7 +82,7 @@ Here is a quick example of some PHP object documents that demonstrates a few of
/** @ODM\Document */
class Employee extends BaseEmployee
{
/** @ODM\ReferenceOne(targetDocument="Documents\Manager") */
/** @ODM\ReferenceOne(targetDocument=Manager::class) */
private $manager;

public function getManager(): ?Manager { return $this->manager; }
Expand All @@ -92,7 +92,7 @@ Here is a quick example of some PHP object documents that demonstrates a few of
/** @ODM\Document */
class Manager extends BaseEmployee
{
/** @ODM\ReferenceMany(targetDocument="Documents\Project") */
/** @ODM\ReferenceMany(targetDocument=Project::class) */
private $projects;

public __construct() { $this->projects = new ArrayCollection(); }
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/map-reduce.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ named ``Event`` and it was related to a ``User`` document:
/** @Id */
private $id;

/** @ReferenceOne(targetDocument="Documents\User") */
/** @ReferenceOne(targetDocument=User::class) */
private $user;

/** @Field(type="string") */
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/migrating-schemas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Later on, you may want to migrate this data into an embedded Address document:
/** @NotSaved */
public $city;

/** @EmbedOne(targetDocument="Address") */
/** @EmbedOne(targetDocument=Address::class) */
public $address;

/** @PostLoad */
Expand Down
4 changes: 2 additions & 2 deletions docs/en/reference/priming-references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Consider the following abbreviated model:
/** @Document */
class User
{
/** @ReferenceMany(targetDocument="Account") */
/** @ReferenceMany(targetDocument=Account::class) */
private $accounts;
}

Expand Down Expand Up @@ -111,7 +111,7 @@ specifying them in the mapping:
/** @Document */
class User
{
/** @ReferenceMany(targetDocument="Account", prime={"user"}) */
/** @ReferenceMany(targetDocument=Account::class, prime={"user"}) */
private $accounts;
}

Expand Down
12 changes: 6 additions & 6 deletions docs/en/reference/reference-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Reference one document:
// ...

/**
* @ReferenceOne(targetDocument="Shipping")
* @ReferenceOne(targetDocument=Shipping::class)
*/
private $shipping;

Expand Down Expand Up @@ -97,7 +97,7 @@ Reference many documents:
// ...

/**
* @ReferenceMany(targetDocument="Account")
* @ReferenceMany(targetDocument=Account::class)
*/
private $accounts = array();

Expand Down Expand Up @@ -286,7 +286,7 @@ Example:
<?php

/**
* @ReferenceOne(targetDocument="Profile", storeAs="id")
* @ReferenceOne(targetDocument=Profile::class, storeAs="id")
*/
private $profile;

Expand Down Expand Up @@ -334,7 +334,7 @@ referenced documents. You must explicitly enable this functionality:
<?php

/**
* @ReferenceOne(targetDocument="Profile", cascade={"persist"})
* @ReferenceOne(targetDocument=Profile::class, cascade={"persist"})
*/
private $profile;

Expand Down Expand Up @@ -391,10 +391,10 @@ and StandingData:
/** @Id */
private $id;

/** @ReferenceOne(targetDocument="StandingData", orphanRemoval=true) */
/** @ReferenceOne(targetDocument=StandingData::class, orphanRemoval=true) */
private $standingData;

/** @ReferenceMany(targetDocument="Address", mappedBy="contact", orphanRemoval=true) */
/** @ReferenceMany(targetDocument=Address::class, mappedBy="contact", orphanRemoval=true) */
private $addresses;

public function __construct()
Expand Down
12 changes: 6 additions & 6 deletions docs/en/reference/trees.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Full Tree in Single Document
/** @Field(type="string") */
private $body;

/** @EmbedMany(targetDocument="Comment") */
/** @EmbedMany(targetDocument=Comment::class) */
private $comments = array();

// ...
Expand All @@ -38,7 +38,7 @@ Full Tree in Single Document
/** @Field(type="string") */
private $text;

/** @EmbedMany(targetDocument="Comment") */
/** @EmbedMany(targetDocument=Comment::class) */
private $replies = array();

// ...
Expand Down Expand Up @@ -77,7 +77,7 @@ Parent Reference
private $name;

/**
* @ReferenceOne(targetDocument="Category")
* @ReferenceOne(targetDocument=Category::class)
* @Index
*/
private $parent;
Expand Down Expand Up @@ -116,7 +116,7 @@ Child Reference
private $name;

/**
* @ReferenceMany(targetDocument="Category")
* @ReferenceMany(targetDocument=Category::class)
* @Index
*/
private $children = array();
Expand Down Expand Up @@ -174,13 +174,13 @@ Array of Ancestors
private $id;

/**
* @ReferenceMany(targetDocument="Category")
* @ReferenceMany(targetDocument=Category::class)
* @Index
*/
private $ancestors = array();

/**
* @ReferenceOne(targetDocument="Category")
* @ReferenceOne(targetDocument=Category::class)
* @Index
*/
private $parent;
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/working-with-objects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ in the $addresses collection.
{
//...
/**
* @ReferenceMany(targetDocument="Address", cascade={"persist", "remove"})
* @ReferenceMany(targetDocument=Address::class, cascade={"persist", "remove"})
*/
private $addresses;
//...
Expand Down
Loading