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 7529003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:32:23+00:00 2026-05-30T04:32:23+00:00

I have inherited a medium sized project that I would like to add an

  • 0

I have inherited a medium sized project that I would like to add an ORM to. I have checked out all the normal options Doctrine, Propel redbean , but they all seem to require me to pollute the business objects with their specific implementations. What I would really like (not sure if it is possible) is to pass my business object with its getters and setters etc and have the ORM persist the values. My main concern here is not tying the app to the ORM.

  • 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-05-30T04:32:24+00:00Added an answer on May 30, 2026 at 4:32 am

    Consider Doctrine2. It doesn’t implement ActiveRecord (which, I think, you consider as a “pollution”), but instead a DataMapper pattern. You can configure Doctrine using annotations.

    <?php
    /** @Entity **/
    class Post
    {
        /** @Id @GeneratedValue @Column(type="integer") **/
        protected $id;
        /** @Column(type="string") **/
        protected $title;
        /** @Column(type="text") **/
        protected $body;
    }
    

    And then

    <?php
    
    use Doctrine\ORM\Tools\Setup;
    use Doctrine\ORM\EntityManager;
    
    require_once 'Doctrine/Common/ClassLoader.php';
    
    $loader = new \Doctrine\Common\ClassLoader("Doctrine");
    $loader->register();
    
    $dbParams = array(
        'driver' => 'pdo_mysql',
        'user' => 'root',
        'password' => '',
        'dbname' => 'tests'
    );
    $path = 'path/to/entities';
    $config = Setup::createAnnotationMetadataConfiguration($path, true);
    $entityManager = EntityManager::create($dbParams, $config);
    ..................
    $entityManager->persist($post);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have inherited a medium sized iOS project - ~30,000 lines of code -
I have inherited a medium sized database that we are trying to use with
I have inherited a reasonable sized ASP.net solution that has no automated tests. The
I have inherited a project, that provides an order form to a customer. The
I have just inherited a medium sized Rails application and I want to try
I have inherited a WiX project from a contractor that recently left. When I
I've a medium chunk of code containing 5 classes that they're all inherited from
I have inherited a project that logs data from a single board computer to
I've inherited a medium sized project in which the main (batch) program is fed
I have inherited a project that uses LLBLGen Pro for the DB layer. The

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.