Development

#3133 (__toString function missing in Tag model)

You must first sign up to be able to contribute.

Ticket #3133 (closed enhancement: fixed)

Opened 9 months ago

Last modified 9 months ago

__toString function missing in Tag model

Reported by: jug Assigned to: xavier
Priority: minor Milestone:
Component: sfPropelActAsTaggablePlugin Version: 1.0.10
Keywords: __toString Tag Cc:
Qualification: Accepted

Description

Hi,

I needed to add the toString function to the Tag model class

  public function __toString()
  {
    return $this->getName();
  }

In order to use such a piece of code :

$critera_A = //... Criteria to get some tags (ex : TagPeer::NAME, $token.'%', Criteria::LIKE )
$criteria_B = //... Another Criteria with different  (ex : TagPeer::NAME, '%'.$token.'%', Criteria::LIKE )
$tags = array_merge( TagPeer::doSelect($criteria_A), TagPeer::doSelect($criteria_B) );

// Here the __toString function is needed...
$tags = array_unique( $tags );

Bye.

Change History

03/18/08 18:23:50 changed by xavier

(In [7952]) sfPropelActAsTaggableBehaviorPlugin: added toString method in the "tag" model - refs #3133

03/18/08 18:24:15 changed by xavier

  • status changed from new to closed.
  • resolution set to fixed.
  • qualification changed from Unreviewed to Accepted.