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

  • SEARCH
  • Home
  • 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 9247105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:38:59+00:00 2026-06-18T09:38:59+00:00

I have an entity Paper which is connected to the paper table in my

  • 0

I have an entity Paper which is connected to the paper table in my project.
In this entity, I have a field title.

The problem is that the field title can have some html tags inside and I need to make some query on this field. The queryes are without html tags.

My idea was to create an extra variable in my entity: title_without_html:

protected title_without_html;

/**
 * Get title_without_html
 *
 * @return text
 */
public function getTitle_without_html()
{
    return  strip_tags($this->title);
}

And also in the constructor, I am creating the title_without_html.

Is this possible? If yes, how to do it properly. Actually, I am getting an error:

[Semantical Error] line 0, col 61 near ‘title_without_html’: Error: Class SciForum\Version2Bundle\Entity\Paper has no field or association named title_without_html

  • 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. Editorial Team
    Editorial Team
    2026-06-18T09:39:00+00:00Added an answer on June 18, 2026 at 9:39 am

    Your code miss a $, and you should avoid not camelCase methods (for consistency with the Doctrine2 generated ones).

    Also, do not rely on the constructor: Doctrine2 do not call the constructor when fetching existing from the database.

    This must work:

    <?php
    
    class Toto {
    
        public function getCleanTitle()
        {
            return strip_tags($this->getTitle());
        }
    }
    

    You don’t have to set a property for this instead you are calling this getter a lot of times (then, a property could be used for caching the result of strip_tags).

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

Sidebar

Related Questions

Hi Need some help with LINQ query. I have entity called Shift. This entity
I have some problem with Morphia. Could someone help me? I am writing web-project
I have a table that used throughout an app by Entity. I have a
I have entity instance(north) NorthdatabaseEntity north = new NorthdatabaseEntity() The problem is that i
I have Entity Framework entities Events which have an EntityCollection of RSVP. I want
I have entity model like this (using EclipseLink and JPA 2.0): @Entity class A
I have entity e.g. Product which aggregates other entities such as Category . Those
In my business model I have Entity class (IPoint interface ) that has a
I used JPA and mysql. Each table have entity class.I have four tables. Table1
i have an entity Entity1 that have one to many relation with Entity2 as

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.