/** * @return string */ function __toString() { $b = new DocBuilder(); // Anotation (@..) if ($this->annotation) { $b->append($this->annotation); } else { if ($this->virtual) { $b->append('@property-read'); } else { $b->append('@property'); } } // Type (int, string..) $b->append($this->type); // Variable ($..) $b->append(sprintf('$%s', $this->variable)); // Default if ($this->default) { $b->append(sprintf('{default %s}', $this->default)); } // Enum {enum ..} if ($this->enum) { $b->append(sprintf('{enum self::%s_*}', $this->enum)); } // Virtual if ($this->virtual) { $b->append('{virtual}'); } // Relation if ($this->relation) { $b->append(sprintf('{%s}', (string) $this->relation)); } return (string) $b; }
/** * @return string */ function __toString() { $b = new DocBuilder(); // Type (1:m, m:1, m:n, etc..) $b->append($this->type); // Entity and variable (Entity::$variable) if ($this->variable) { $b->str(ucfirst($this->entity)); $b->str('::'); $b->append('$' . $this->variable); } else { $b->append(ucfirst($this->entity)); } // Primary if ($this->primary) { $b->append('primary'); } // Order (order:*property*) if ($this->orderProperty) { $b->append('order:' . $this->orderProperty); } // Ordering (DESC/ASC) if ($this->orderDirection) { $b->append($this->orderDirection === self::ASC ? 'ASC' : 'DESC'); } return (string) $b; }