Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 93423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:20:31+00:00 2026-05-10T23:20:31+00:00

I’m creating a simple tag system that allows me to link a tag to

  • 0

I’m creating a simple tag system that allows me to link a tag to almost everything in my application. In order to facilitate this, I created a table called ‘objects’, referenced by my model ‘Object’.

I’ve got three models setup at the moment:

  • Tag (with TagObject defined as a dependentTable)
  • Object (with TagObject defined as a dependedTable)
  • TagObject (with both Tag and Object defined in the referenceMap)

I already created some simple methods like fetchTagById() and fetchTagByName() in my Tag model, but now I want to create a method that gets my tags and their respective occurences in the objects table, in order to create a simple tag cloud.

Structure-wise, what is the best location to create this method (using findDependentRowset())?

I somehow feel it is not very good practise to store this in my Tag model, but storing it in my TagObject model seems awkward too, and might overcomplicate things.

Any advice would be greatly appreciated.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T23:20:32+00:00Added an answer on May 10, 2026 at 11:20 pm

    If the method retrieves the tags, then it should be in the tag model. If it retrieves objects, it should be in the object model. Since you are retrieving tags and their occurrences, it should be in the tag model.

    I would call the model Tags not Tag, since Tag is a Row in Tags and in the ZF the model is usually a DataGateway to a table. Same with objects.

    $tags = new Tags(); $cloud = $tags -> getWithObjectOccurrences(); 

    On another note, I would never name a class ‘object’ or ‘objects’ as it is too generic (objects are a basic language construct). Consider finding a more descriptive name for it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I know there's a lot of other questions out there that deal with this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.