ActiveRelationInterface.php 1019 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace yii\db;
  8. /**
  9. * ActiveRelationInterface defines the common interface to be implemented by active record relation classes.
  10. *
  11. * A class implementing this interface should also use [[ActiveRelationTrait]].
  12. *
  13. * @author Qiang Xue <[email protected]>
  14. * @author Carsten Brandt <[email protected]>
  15. * @since 2.0
  16. */
  17. interface ActiveRelationInterface extends ActiveQueryInterface
  18. {
  19. /**
  20. * Specifies the relation associated with the pivot table.
  21. * @param string $relationName the relation name. This refers to a relation declared in [[primaryModel]].
  22. * @param callable $callable a PHP callback for customizing the relation associated with the pivot table.
  23. * Its signature should be `function($query)`, where `$query` is the query to be customized.
  24. * @return static the relation object itself.
  25. */
  26. public function via($relationName, $callable = null);
  27. }