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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:11:10+00:00 2026-06-04T17:11:10+00:00

Is it possible to represent the fifth normal form in PHP ActiveRecord? i.e. Person

  • 0

Is it possible to represent the fifth normal form in PHP ActiveRecord?

i.e.

Person <=> (person_id) person_phone (phone_id) <=> Phone
  • 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-04T17:11:11+00:00Added an answer on June 4, 2026 at 5:11 pm

    The fifth normal can be represented with “$has_many through”

    http://www.phpactiverecord.org/projects/main/wiki/Associations

    has_many through (many to many)
    
    This is a convenient way to configure a many-to-many association. 
    

    In this example an order is associated with users by going the
    its payments association.

     1 class Order extends ActiveRecord\Model {
     2   static $has_many = array(
     3     array('payments'),
     4     array('users', 'through' => 'payments')
     5   );
     6 }
     7 
     8 class Payment extends ActiveRecord\Model {
     9   static $belongs_to = array(
    10     array('user'),
    11     array('order')
    12   );
    13 }
    14 
    15 class User extends ActiveRecord\Model {
    16   static $has_many = array(
    17     array('payments')
    18   );
    19 }
    20 
    21 $order = Order::first();
    22 # direct access to users
    23 print_r($order->users); # will print an array of User object
    

    I found the answer here:

    You could create a model for the joint table, and then associate the phone table through the join table!

    http://www.phpactiverecord.org/boards/4/topics/226

    Also found this:
    http://svn.phpontrax.com/wiki/ActiveRecordTableAssociations

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

Sidebar

Related Questions

Is it possible to have a Django form field represent form values as slugs
Possible Duplicate: How to represent 18bit color depth to 16bit color depth? I'm porting
Possible Duplicate: What does a type followed by _t (underscore-t) represent? While typing in
Possible Duplicate: What does a type followed by _t (underscore-t) represent? Does anyone knows
I'm trying to represent the result of an MD5 hash in the shortest possible
Possible Duplicate: Best way to stop SQL Injection in PHP I am creating a
(How) is it possible to represent monads in Scala in a generic way (like
Is it possible to represent one data series as points and another as lines?
http://jsfiddle.net/vrcQp/ I want these buttons to be centered (the three versions represent different possible
Possible Duplicate: What does a type followed by _t (underscore-t) represent? I have seen

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.