acceptTracking

acceptTracking

PREMIUM TRIAL / ADVANCED

Accepts tracked contents or styles.

Description
public acceptTracking (array $referenceNode)
Parameters

referenceNode

An array to get the refence node.
The possible keys and values of this array are:

Key Type Description
type string
  • * (all, default value)
  • break
  • chart
  • endnote (content reference)
  • footnote (content reference)
  • image
  • list
  • math
  • paragraph (also for bookmarks, links and lists)
  • section
  • shape
  • table
contains string Contains a text string.
occurrence mixed
  • (int) exact occurrence (from 1)
  • (array) occurrences
  • (string) range of contents (e.g.: '2..9', '2..', '..9') or 'first()' or 'last()'
attributes array Contains a specific attribute key and value.
parent string Main document body as default, allows to set any parent or a specific one. w:body (default), '/' (any parent) or any other specific parent (/w:tbl/, /w:tc/, /w:r/...).
customQuery string Custom xpath query, overwrites any other reference.
Exceptions

Method not available.

Code samples

Example #1

Release notes
  • phpdocx 17.0:
    • occurrence option allows setting an array.
  • phpdocx 15.5:
    • math type.
  • phpdocx 15.0:
    • table-row, table-cell and table-cell-paragraph types.
  • phpdocx 9.0:
    • new method.