Questions tagged [baseelementmodel]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
0answers
75 views

Unable to get relatedTo working on an ElementCriteriaModel

In a plugin I am trying to get Users related to other Users: $criteria = craft()->elements->getCriteria(ElementType::User); $criteria->group = 'partners'; $criteria->relatedTo = [ '...
2
votes
1answer
144 views

Does defineSearchableAttributes() work with getter methods on the model?

If I define searchable fields via IElementType::defineSearchableAttributes(), the provided fields have to be model attributes. Can they also be getter-methods on the model class, which may return ...
1
vote
0answers
124 views

FieldElement Solr

for the last few hours im trying to come up with a way to use the craft field select in combination with SOLR, all my entries are in solr and i i want to keep using that. ive made it so that solr can ...
2
votes
1answer
184 views

Why does my custom element type error around locale being missing on the element types' model?

I have made numerous elementTypes in my plugin that all work perfectly but for some reason one elementType keeps having an error when trying to view the Model's content or custom fields. This is the ...
3
votes
1answer
35 views

Why is ElementsService forgiving of an element type whose populateElementModel() method doesn’t return an actual element model

In the 2.3 release notes, one item reads: ElementsService is now forgiving of an element type whose populateElementModel() method doesn’t return an actual element model. I'm curious what the use ...
15
votes
1answer
3k views

What is getContent() / the ContentModel, and how do I use it to get and set custom field values?

If I want to retrieve content on an element, should I be calling $entry->$fieldHandle or $entry->getContent()->$fieldHandle? What’s the difference? Likewise, if I’m setting new content on an ...