UML2PHP5 -> Support::relationships-aggregation
French version

UML diagram
Diagramme UML: héritage
Support by UML2PHP5
Constraint Supported
Generate all necessaries requires inside MyClassA.class.php YES
Generate an attribute which name is the declared associating role name (here is myB) YES
Generate an attribute which name is derivated from the part class with $O_ prefix (here $O_MyClassC) if no associating role name was defined and AGGREGATION_IMPLICIT_NAMING parameter from config file is ON (default) YES
If the cardinality (multiplicity) was set to 1 or was not defined, the attribute will be set to NULL (here is the case of $myB). YES
If the cardinality is different from 1, the attribute will be set to array() (here is the case of $O_myClassC). YES
Generate accept_rolename method if an associating role name was defined (here is the case of myB). YES
Generate accept_classnameElement (here accept_MyClassCElement) if no associating role name was defined and AGGREGATION_IMPLICIT_NAMING parameter from config file is set to ON (default). YES
File: MyClassA.class.php
<?php
/**
 * 
 * Code skeleton generated by dia-uml2php5 plugin
 * written by KDO kdo@zpmag.com 
 */
require_once('MyClassB.class.php');
require_once('MyClassC.class.php');

class MyClassA {

   /**
    * Component
    * @var MyClassB
    * @access private
    */

   private $myB = NULL ;

   /**
    * Component
    * @var MyClassC
    * @access private
    */

   private $O_MyClassC = array() ;
	
   /**
    * 
    * @var string
    * @access public
    */

   public  $MyAttribute;


   /**
    * AGGREGATION: accept MyClassB element
    * @param MyClassB $element
    * @access public
    */

   public function accept_MyB(MyClassB $element) {
      $this->MyB = $element;
   }


   /**
    * AGGREGATION: accept MyClassC element
    * @param MyClassC $element
    * @access public
    */

   public function accept_MyClassCElement(MyClassC $element) {
      $this->O_MyClassC[] = $element;
   }


}
?>

Valid XHTML 1.1! Valid CSS! Mozilla Homepage Apache Web Server! PHP: Hypertext Processor MySQL: Open Source Database
Get Firefox!