Answers.Body: <p>It appears the preferred way is by using <code>getDescendants()</code> — In fact, the <code>children</code> property is actually an alias for <code>getDescendants(1)</code>. (The parameter specifies a maximum distance (i.e. number of levels) of the child from the parent.)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-04T14:12:31.120Z
Answers.Text: Yes, you should use `getDescendants`. But the error came because you applied `getChildren` to the wrong type of elements (`getChildren` was replaced with `relatedTo` for these type of relations at some point).
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-04T14:15:50.313Z
Answers.Text: Just found it in the [Craft 1.3.2409 release notes](http://buildwithcraft.com/updates#build2409).
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-04T14:00:22.693Z
Answers.LastActivityDate: 2014-12-04T14:00:22.693Z
Answers.UserDisplayName: Michael Rog
Body: <p>My templates that referenced <code>entry.children</code> or <code>entry.getChildren()</code> have started throwing deprecation notices:</p>
  
  <blockquote>
    <p>Calling getChildren() to fetch an element’s target relations has been deprecated. Use the relatedTo param instead.</p>
  </blockquote>
  
  <p>What is the preferred way to search for an entry's children — either ALL of its children, or just its direct children — using the <code>relatedTo()</code> param?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-12-04T07:57:23.523Z
Comments.Text: What type of entries are these? You should not get these messages for structure entries (see [BaseElementModel, line 540](https://github.com/pixelandtonic/Craft-Release/blob/059e8e12ea3886dd1d8b5900a81c22fb562f7759/app/models/BaseElementModel.php#L540)).
Comments.UserDisplayName: carlcs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-12-04T14:03:41.477Z
Comments.Text: Good catch, @carlcs. My use case is in generating some nav links. (There are a few edge cases where my `entry` may not be a structure entry, in which case it has no children and generates no nav options...)
Comments.UserDisplayName: Michael Rog
Tags: <structure><relations><children>
Title: How to search children with relatedTo param
ThreadText: # How to search children with relatedTo param
  
  (Asked by: username_0 on 2014-12-03)
  
  My templates that referenced `entry.children` or `entry.getChildren()` have started throwing deprecation notices:
  
  > Calling getChildren() to fetch an element’s target relations has been deprecated. Use the relatedTo param instead.
  
  What is the preferred way to search for an entry's children — either ALL of its children, or just its direct children — using the `relatedTo()` param?
  
  **Tags:** structure, relations, children
  
  > **Comments:**
  > **username_1**: What type of entries are these? You should not get these messages for structure entries (see [BaseElementModel, line 540](https://github.com/pixelandtonic/Craft-Release/blob/059e8e12ea3886dd1d8b5900a81c22fb562f7759/app/models/BaseElementModel.php#L540)).  
  > **username_0**: Good catch, @username_1. My use case is in generating some nav links. (There are a few edge cases where my `entry` may not be a structure entry, in which case it has no children and generates no nav options...)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2014-12-04. Score: 5
  
  It appears the preferred way is by using `getDescendants()` — In fact, the `children` property is actually an alias for `getDescendants(1)`. (The parameter specifies a maximum distance (i.e. number of levels) of the child from the parent.)
  
  > **Comments:**
  > **username_1**: Yes, you should use `getDescendants`. But the error came because you applied `getChildren` to the wrong type of elements (`getChildren` was replaced with `relatedTo` for these type of relations at some point).  
  > **username_1**: Just found it in the [Craft 1.3.2409 release notes](http://buildwithcraft.com/updates#build2409).  
  
  ---
  
  