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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:18:34+00:00 2026-06-12T05:18:34+00:00

I got 2 models: class Mail with relation: ‘relAttachments’ => array(self::MANY_MANY, ‘File’, ‘rel_mail_file(rel_mail, rel_file)’),

  • 0

I got 2 models:

class Mail with relation:

'relAttachments' => array(self::MANY_MANY, 'File', 'rel_mail_file(rel_mail, rel_file)'),

Mail has the AdvancedArBehavior extension attached so i can link Attachments to it with a 1-liner, which i do like this:

$mail->relAttachments = $attachments; // $attachments is an array of ids for `File` models

class Mailque with relation:

'relMail' => array(self::BELONGS_TO, 'Mail', 'rel_mail'),

Once i saved and linked Mail and Mailque, i run this code after sending out the mail:

$mail = Mail::model()->findByPk($id);
$mailModel = $mail->relMail;

var_dump(count($mailModel->relAttachments));  // outputs 1

$mailModel->sent = time();
$mailModel->save();
//$mail->delete();

The call to save() yields the following error:

exception 'CException' with message 'Property "File.rel_file" is not defined.' in ...\framework\base\CComponent.php:131

Does anyone know what is going on here?

  • 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-12T05:18:36+00:00Added an answer on June 12, 2026 at 5:18 am

    Look like you need to define a public variable in File model.

    try this… in File class

    public $rel_file = 'id';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got two models: class Solution < ActiveRecord::Base belongs_to :owner, :class_name => User, :foreign_key
I've got these models class PlayersToTeam < ActiveRecord::Base belongs_to :player belongs_to :team accepts_nested_attributes_for :player
I've got a set of models that look like this: class Page(models.Model): title =
So, I got mailer app/mailers/dynamic_mailer.rb and model app/models/email_message/outgoing.rb . There is method: class EmailMessage::Outgoing
I got 2 models class Category(models.Model): name = models.CharField(max_length=30, unique=True) class Post(models.Model): ...... category
I've got some models set up like this: class AppGroup(models.Model): users = models.ManyToManyField(User) class
got 2 models: class User < ActiveRecord::Base has_many :posts end and class Post <
In a Rails 2.3.5 application I've got something like the following models: class Foo
I've got a model like this: class Thing(models.Model): property1 = models.IntegerField() property2 = models.IntegerField()
I've got two models like these: class Schedule(models.Model): name = models.CharField(_('name'), blank=True, max_length=15) class

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.