umbrello 25.04.3
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
PhpWriter Class Reference

#include <phpwriter.h>

Inheritance diagram for PhpWriter:
Collaboration diagram for PhpWriter:

Public Member Functions

 PhpWriter ()
virtual ~PhpWriter ()
virtual void writeClass (UMLClassifier *c)
virtual Uml::ProgrammingLanguage::Enum language () const
virtual QStringList reservedKeywords () const
Public Member Functions inherited from SimpleCodeGenerator
 SimpleCodeGenerator (bool createDirHierarchyForPackages=true)
virtual ~SimpleCodeGenerator ()
void writeCodeToFile (UMLClassifierList &concepts)
void writeCodeToFile ()
Public Member Functions inherited from CodeGenerator
 CodeGenerator ()
virtual ~CodeGenerator ()
bool addCodeDocument (CodeDocument *add_object)
bool removeCodeDocument (CodeDocument *remove_object)
CodeDocumentListgetCodeDocumentList ()
QString getUniqueID (CodeDocument *codeDoc)
virtual void saveToXMI (QXmlStreamWriter &writer)
CodeDocumentfindCodeDocumentByID (const QString &id)
void setIncludeHeadings (bool i)
bool includeHeadings () const
void setHeadingFileDir (const QString &)
QString headingFileDir () const
void setForceDoc (bool f)
bool forceDoc () const
void setSectionCommentPolicy (CodeGenerationPolicy::WriteSectionCommentsPolicy f)
bool forceSections () const
virtual QString getHeadingFile (const QString &file)
QString findFileName (CodeDocument *codeDocument)
virtual void loadFromXMI (QDomElement &element)
CodeDocumentfindCodeDocumentByClassifier (UMLClassifier *classifier)
virtual QStringList defaultDatatypes () const
virtual bool isReservedKeyword (const QString &keyword)
virtual void createDefaultStereotypes ()

Private Member Functions

void writeOperations (UMLClassifier *c, QTextStream &php)
void writeOperations (const QString &classname, UMLOperationList &opList, QTextStream &php)
void writeAttributes (UMLClassifier *c, QTextStream &php)
void writeAttributes (UMLAttributeList &atList, QTextStream &php)

Additional Inherited Members

Public Types inherited from CodeGenerator
enum  GenerationState { Generated , Failed , Skipped }
Public Slots inherited from SimpleCodeGenerator
virtual void syncCodeToDocument ()
Public Slots inherited from CodeGenerator
virtual void syncCodeToDocument ()
Signals inherited from CodeGenerator
void codeGenerated (UMLClassifier *classifier, bool generated)
void codeGenerated (UMLClassifier *classifier, CodeGenerator::GenerationState result)
void showGeneratedFile (const QString &filename)
Static Public Member Functions inherited from CodeGenerator
static QString cleanName (const QString &name)
static QString formatDoc (const QString &text, const QString &linePrefix=QStringLiteral(" *"), int lineWidth=80)
static QString formatFullDocBlock (const QString &text, const QString &blockHeader=QStringLiteral("/* "), const QString &blockFooter=QStringLiteral(" */"), const QString &linePrefix=QStringLiteral(" *"), int lineWidth=80)
static QString formatSourceCode (const QString &code, const QString &indentation)
static void findObjectsRelated (UMLClassifier *c, UMLPackageList &cList)
Protected Member Functions inherited from SimpleCodeGenerator
QString findFileName (UMLPackage *classifier, const QString &ext)
QString overwritableName (UMLPackage *classifier, const QString &name, const QString &ext)
bool hasDefaultValueAttr (UMLClassifier *c)
bool hasAbstractOps (UMLClassifier *c)
QString indent ()
virtual void initFromParentDocument ()
Protected Member Functions inherited from CodeGenerator
QString overwritableName (const QString &name, const QString &extension)
bool openFile (QFile &file, const QString &name)
void writeListedCodeDocsToFile (CodeDocumentList *docs)
virtual void finalizeRun ()
Protected Attributes inherited from SimpleCodeGenerator
QString className_
QString fileName_
QMap< UMLPackage *, QString > m_fileMap
bool m_createDirHierarchyForPackages
QString m_indentation
int m_indentLevel
QString m_endl
Protected Attributes inherited from CodeGenerator
QHash< QString, CodeDocument * > m_codeDocumentDictionary
bool m_applyToAllRemaining
UMLDocm_document

Detailed Description

Class PhpWriter is a PHP code generator for UMLClassifier objects. Just call writeClass and feed it a UMLClassifier.

Constructor & Destructor Documentation

◆ PhpWriter()

PhpWriter::PhpWriter ( )

◆ ~PhpWriter()

PhpWriter::~PhpWriter ( )
virtual

Member Function Documentation

◆ language()

Uml::ProgrammingLanguage::Enum PhpWriter::language ( ) const
virtual

Returns "PHP".

Returns
the programming language identifier

Implements CodeGenerator.

◆ reservedKeywords()

QStringList PhpWriter::reservedKeywords ( ) const
virtual

Get list of reserved keywords.

Returns
the list of reserved keywords

Reimplemented from CodeGenerator.

◆ writeAttributes() [1/2]

void PhpWriter::writeAttributes ( UMLAttributeList & atList,
QTextStream & php )
private

Write a list of class attributes.

Parameters
atListthe list of attributes
phpoutput stream for the PHP file
Here is the call graph for this function:

◆ writeAttributes() [2/2]

void PhpWriter::writeAttributes ( UMLClassifier * c,
QTextStream & php )
private

Write all the attributes of a class.

Parameters
cthe class we are generating code for
phpoutput stream for the PHP file
Here is the call graph for this function:

◆ writeClass()

void PhpWriter::writeClass ( UMLClassifier * c)
virtual

Call this method to generate Php code for a UMLClassifier.

Parameters
cthe class you want to generate code for.

Implements SimpleCodeGenerator.

Here is the call graph for this function:

◆ writeOperations() [1/2]

void PhpWriter::writeOperations ( const QString & classname,
UMLOperationList & opList,
QTextStream & php )
private

Write a list of class operations.

Parameters
classnamethe name of the class
opListthe list of operations
phpoutput stream for the PHP file
Here is the call graph for this function:

◆ writeOperations() [2/2]

void PhpWriter::writeOperations ( UMLClassifier * c,
QTextStream & php )
private

Write all operations for a given class.

Parameters
cthe classifier we are generating code for
phpoutput stream for the PHP file
Here is the call graph for this function:

The documentation for this class was generated from the following files: