246 lines
11 KiB
HTML
246 lines
11 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
|
|
<html lang="en">
|
|
<head>
|
|
|
|
<meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)">
|
|
<meta name="when" content="Wed, 14 Apr 2010 15:12:06 +0000">
|
|
|
|
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
|
|
<link rel="start" href="../../../overview-summary.html">
|
|
|
|
<title>EntityGenerator (Doctrine)</title>
|
|
|
|
</head>
|
|
<body id="definition" onload="parent.document.title=document.title;">
|
|
|
|
<div class="header">
|
|
<h1>Doctrine</h1>
|
|
<ul>
|
|
<li><a href="../../../overview-summary.html">Overview</a></li>
|
|
<li><a href="../../../doctrine/orm/tools/package-summary.html">Namespace</a></li>
|
|
<li class="active">Class</li>
|
|
<li><a href="../../../doctrine/orm/tools/package-tree.html">Tree</a></li>
|
|
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../index-all.html">Index</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="small_links">
|
|
<a href="../../../index.html" target="_top">Frames</a>
|
|
<a href="../../../doctrine/orm/tools/entitygenerator.html" target="_top">No frames</a>
|
|
</div>
|
|
<div class="small_links">
|
|
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
|
|
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
|
|
</div>
|
|
<hr>
|
|
|
|
<div class="qualifiedName">Doctrine\ORM\Tools\EntityGenerator</div>
|
|
<div class="location">/Doctrine/ORM/Tools/EntityGenerator.php at line 50</div>
|
|
|
|
<h1>Class EntityGenerator</h1>
|
|
|
|
<pre class="tree"><strong>EntityGenerator</strong><br /></pre>
|
|
|
|
<hr>
|
|
|
|
<p class="signature">public class <strong>EntityGenerator</strong></p>
|
|
|
|
<div class="comment" id="overview_description"><p>Generic class used to generate PHP5 entity classes from ClassMetadataInfo instances</p><p>[php]
|
|
$classes = $em->getClassMetadataFactory()->getAllMetadata();</p><p>$generator = new \Doctrine\ORM\Tools\EntityGenerator();
|
|
$generator->setGenerateAnnotations(true);
|
|
$generator->setGenerateStubMethods(true);
|
|
$generator->setRegenerateEntityIfExists(false);
|
|
$generator->setUpdateEntityIfExists(true);
|
|
$generator->generate($classes, '/path/to/generate/entities');</p></div>
|
|
|
|
<dl>
|
|
<dt>License:</dt>
|
|
<dd>http://www.opensource.org/licenses/lgpl-license.php LGPL</dd>
|
|
<dt>See Also:</dt>
|
|
<dd><code>www.doctrine-project.org</code></dd>
|
|
<dt>Since:</dt>
|
|
<dd>2.0</dd>
|
|
<dt>Version:</dt>
|
|
<dd>$Revision$</dd>
|
|
<dt>Author:</dt>
|
|
<dd>Benjamin Eberlei <kontakt@beberlei.de></dd>
|
|
<dd>Guilherme Blanco <guilhermeblanco@hotmail.com></dd>
|
|
<dd>Jonathan Wage <jonwage@gmail.com></dd>
|
|
<dd>Roman Borschel <roman@code-factory.org></dd>
|
|
</dl>
|
|
<hr>
|
|
|
|
<table id="summary_method">
|
|
<tr><th colspan="2">Method Summary</th></tr>
|
|
<tr>
|
|
<td class="type"> void</td>
|
|
<td class="description"><p class="name"><a href="#generate()">generate</a>(array metadatas, string outputDirectory)</p><p class="description">Generate and write entity classes for the given array of ClassMetadataInfo instances</p></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="type"> string</td>
|
|
<td class="description"><p class="name"><a href="#generateEntityClass()">generateEntityClass</a>(<a href="../../../doctrine/orm/mapping/classmetadatainfo.html">ClassMetadataInfo</a> metadata)</p><p class="description">Generate a PHP5 Doctrine 2 entity class from the given ClassMetadataInfo instance</p></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="type"> string</td>
|
|
<td class="description"><p class="name"><a href="#generateUpdatedEntityClass()">generateUpdatedEntityClass</a>(<a href="../../../doctrine/orm/mapping/classmetadatainfo.html">ClassMetadataInfo</a> metadata, string path)</p><p class="description">Generate the updated code for the given ClassMetadataInfo and entity at path</p></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="type"> void</td>
|
|
<td class="description"><p class="name"><a href="#setClassToExtend()">setClassToExtend</a>(mixed classToExtend)</p><p class="description">Set the name of the class the generated classes should extend from</p></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="type"> void</td>
|
|
<td class="description"><p class="name"><a href="#setExtension()">setExtension</a>(string extension)</p><p class="description">Set the extension to use when writing php files to disk</p></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="type"> void</td>
|
|
<td class="description"><p class="name"><a href="#setGenerateAnnotations()">setGenerateAnnotations</a>(bool bool)</p><p class="description">Set whether or not to generate annotations for the entity</p></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="type"> void</td>
|
|
<td class="description"><p class="name"><a href="#setGenerateStubMethods()">setGenerateStubMethods</a>(bool bool)</p><p class="description">Set whether or not to generate stub methods for the entity</p></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="type"> void</td>
|
|
<td class="description"><p class="name"><a href="#setNumSpaces()">setNumSpaces</a>(integer numSpaces)</p><p class="description">Set the number of spaces the exported class should have</p></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="type"> void</td>
|
|
<td class="description"><p class="name"><a href="#setRegenerateEntityIfExists()">setRegenerateEntityIfExists</a>(bool bool)</p><p class="description">Set whether or not to regenerate the entity if it exists</p></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="type"> void</td>
|
|
<td class="description"><p class="name"><a href="#setUpdateEntityIfExists()">setUpdateEntityIfExists</a>(bool bool)</p><p class="description">Set whether or not to try and update the entity if it already exists</p></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="type"> void</td>
|
|
<td class="description"><p class="name"><a href="#writeEntityClass()">writeEntityClass</a>(<a href="../../../doctrine/orm/mapping/classmetadatainfo.html">ClassMetadataInfo</a> metadata, string outputDirectory)</p><p class="description">Generated and write entity class to disk for the given ClassMetadataInfo instance</p></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h2 id="detail_method">Method Detail</h2>
|
|
<div class="location">/Doctrine/ORM/Tools/EntityGenerator.php at line 142</div>
|
|
<h3 id="generate()">generate</h3>
|
|
<code class="signature">public void <strong>generate</strong>(array metadatas, string outputDirectory)</code>
|
|
<div class="details">
|
|
<p>Generate and write entity classes for the given array of ClassMetadataInfo instances</p></div>
|
|
|
|
<hr>
|
|
|
|
<div class="location">/Doctrine/ORM/Tools/EntityGenerator.php at line 188</div>
|
|
<h3 id="generateEntityClass()">generateEntityClass</h3>
|
|
<code class="signature">public string <strong>generateEntityClass</strong>(<a href="../../../doctrine/orm/mapping/classmetadatainfo.html">ClassMetadataInfo</a> metadata)</code>
|
|
<div class="details">
|
|
<p>Generate a PHP5 Doctrine 2 entity class from the given ClassMetadataInfo instance</p><dl>
|
|
<dt>Returns:</dt>
|
|
<dd>$code</dd>
|
|
</dl>
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<div class="location">/Doctrine/ORM/Tools/EntityGenerator.php at line 216</div>
|
|
<h3 id="generateUpdatedEntityClass()">generateUpdatedEntityClass</h3>
|
|
<code class="signature">public string <strong>generateUpdatedEntityClass</strong>(<a href="../../../doctrine/orm/mapping/classmetadatainfo.html">ClassMetadataInfo</a> metadata, string path)</code>
|
|
<div class="details">
|
|
<p>Generate the updated code for the given ClassMetadataInfo and entity at path</p><dl>
|
|
<dt>Returns:</dt>
|
|
<dd>$code;</dd>
|
|
</dl>
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<div class="location">/Doctrine/ORM/Tools/EntityGenerator.php at line 254</div>
|
|
<h3 id="setClassToExtend()">setClassToExtend</h3>
|
|
<code class="signature">public void <strong>setClassToExtend</strong>(mixed classToExtend)</code>
|
|
<div class="details">
|
|
<p>Set the name of the class the generated classes should extend from</p></div>
|
|
|
|
<hr>
|
|
|
|
<div class="location">/Doctrine/ORM/Tools/EntityGenerator.php at line 244</div>
|
|
<h3 id="setExtension()">setExtension</h3>
|
|
<code class="signature">public void <strong>setExtension</strong>(string extension)</code>
|
|
<div class="details">
|
|
<p>Set the extension to use when writing php files to disk</p></div>
|
|
|
|
<hr>
|
|
|
|
<div class="location">/Doctrine/ORM/Tools/EntityGenerator.php at line 265</div>
|
|
<h3 id="setGenerateAnnotations()">setGenerateAnnotations</h3>
|
|
<code class="signature">public void <strong>setGenerateAnnotations</strong>(bool bool)</code>
|
|
<div class="details">
|
|
<p>Set whether or not to generate annotations for the entity</p></div>
|
|
|
|
<hr>
|
|
|
|
<div class="location">/Doctrine/ORM/Tools/EntityGenerator.php at line 298</div>
|
|
<h3 id="setGenerateStubMethods()">setGenerateStubMethods</h3>
|
|
<code class="signature">public void <strong>setGenerateStubMethods</strong>(bool bool)</code>
|
|
<div class="details">
|
|
<p>Set whether or not to generate stub methods for the entity</p></div>
|
|
|
|
<hr>
|
|
|
|
<div class="location">/Doctrine/ORM/Tools/EntityGenerator.php at line 232</div>
|
|
<h3 id="setNumSpaces()">setNumSpaces</h3>
|
|
<code class="signature">public void <strong>setNumSpaces</strong>(integer numSpaces)</code>
|
|
<div class="details">
|
|
<p>Set the number of spaces the exported class should have</p></div>
|
|
|
|
<hr>
|
|
|
|
<div class="location">/Doctrine/ORM/Tools/EntityGenerator.php at line 287</div>
|
|
<h3 id="setRegenerateEntityIfExists()">setRegenerateEntityIfExists</h3>
|
|
<code class="signature">public void <strong>setRegenerateEntityIfExists</strong>(bool bool)</code>
|
|
<div class="details">
|
|
<p>Set whether or not to regenerate the entity if it exists</p></div>
|
|
|
|
<hr>
|
|
|
|
<div class="location">/Doctrine/ORM/Tools/EntityGenerator.php at line 276</div>
|
|
<h3 id="setUpdateEntityIfExists()">setUpdateEntityIfExists</h3>
|
|
<code class="signature">public void <strong>setUpdateEntityIfExists</strong>(bool bool)</code>
|
|
<div class="details">
|
|
<p>Set whether or not to try and update the entity if it already exists</p></div>
|
|
|
|
<hr>
|
|
|
|
<div class="location">/Doctrine/ORM/Tools/EntityGenerator.php at line 156</div>
|
|
<h3 id="writeEntityClass()">writeEntityClass</h3>
|
|
<code class="signature">public void <strong>writeEntityClass</strong>(<a href="../../../doctrine/orm/mapping/classmetadatainfo.html">ClassMetadataInfo</a> metadata, string outputDirectory)</code>
|
|
<div class="details">
|
|
<p>Generated and write entity class to disk for the given ClassMetadataInfo instance</p></div>
|
|
|
|
<hr>
|
|
|
|
<div class="header">
|
|
<h1>Doctrine</h1>
|
|
<ul>
|
|
<li><a href="../../../overview-summary.html">Overview</a></li>
|
|
<li><a href="../../../doctrine/orm/tools/package-summary.html">Namespace</a></li>
|
|
<li class="active">Class</li>
|
|
<li><a href="../../../doctrine/orm/tools/package-tree.html">Tree</a></li>
|
|
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../index-all.html">Index</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="small_links">
|
|
<a href="../../../index.html" target="_top">Frames</a>
|
|
<a href="../../../doctrine/orm/tools/entitygenerator.html" target="_top">No frames</a>
|
|
</div>
|
|
<div class="small_links">
|
|
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
|
|
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
|
|
</div>
|
|
<hr>
|
|
|
|
<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>
|
|
|
|
</body>
|
|
|
|
</html> |