本文整理汇总了PHP中PropelObjectCollection::contains方法的典型用法代码示例。如果您正苦于以下问题:PHP PropelObjectCollection::contains方法的具体用法?PHP PropelObjectCollection::contains怎么用?PHP PropelObjectCollection::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropelObjectCollection
的用法示例。
在下文中一共展示了PropelObjectCollection::contains方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testContains
public function testContains()
{
$col = new PropelObjectCollection();
$books = PropelQuery::from('Book')->find();
$this->assertFalse($col->contains($books[0]));
$this->assertFalse($col->contains($books[1]));
$col[] = $books[0];
$this->assertTrue($col->contains($books[0]));
$this->assertFalse($col->contains($books[1]));
}
示例2: testContains
public function testContains()
{
$col = new PropelObjectCollection();
$book1 = new Book();
$book1->setTitle('Foo');
$book2 = new Book();
$book2->setTitle('Bar');
$col = new PropelObjectCollection();
$this->assertFalse($col->contains($book1));
$this->assertFalse($col->contains($book2));
$col[] = $book1;
$this->assertTrue($col->contains($book1));
$this->assertFalse($col->contains($book2));
}
示例3: addPropiedadvalor
/**
* Method called to associate a Propiedadvalor object to this object
* through the Propiedadvalor foreign key attribute.
*
* @param Propiedadvalor $l Propiedadvalor
* @return Propiedad The current object (for fluent API support)
*/
public function addPropiedadvalor(Propiedadvalor $l)
{
if ($this->collPropiedadvalors === null) {
$this->initPropiedadvalors();
$this->collPropiedadvalorsPartial = true;
}
if (!in_array($l, $this->collPropiedadvalors->getArrayCopy(), true)) {
// only add it if the **same** object is not already associated
$this->doAddPropiedadvalor($l);
if ($this->propiedadvalorsScheduledForDeletion and $this->propiedadvalorsScheduledForDeletion->contains($l)) {
$this->propiedadvalorsScheduledForDeletion->remove($this->propiedadvalorsScheduledForDeletion->search($l));
}
}
return $this;
}
示例4: addArticulo
/**
* Method called to associate a Articulo object to this object
* through the Articulo foreign key attribute.
*
* @param Articulo $l Articulo
* @return Tipo The current object (for fluent API support)
*/
public function addArticulo(Articulo $l)
{
if ($this->collArticulos === null) {
$this->initArticulos();
$this->collArticulosPartial = true;
}
if (!in_array($l, $this->collArticulos->getArrayCopy(), true)) {
// only add it if the **same** object is not already associated
$this->doAddArticulo($l);
if ($this->articulosScheduledForDeletion and $this->articulosScheduledForDeletion->contains($l)) {
$this->articulosScheduledForDeletion->remove($this->articulosScheduledForDeletion->search($l));
}
}
return $this;
}
示例5: addDetailTransaksi
/**
* Method called to associate a DetailTransaksi object to this object
* through the DetailTransaksi foreign key attribute.
*
* @param DetailTransaksi $l DetailTransaksi
* @return Transaksi The current object (for fluent API support)
*/
public function addDetailTransaksi(DetailTransaksi $l)
{
if ($this->collDetailTransaksis === null) {
$this->initDetailTransaksis();
$this->collDetailTransaksisPartial = true;
}
if (!in_array($l, $this->collDetailTransaksis->getArrayCopy(), true)) {
// only add it if the **same** object is not already associated
$this->doAddDetailTransaksi($l);
if ($this->detailTransaksisScheduledForDeletion and $this->detailTransaksisScheduledForDeletion->contains($l)) {
$this->detailTransaksisScheduledForDeletion->remove($this->detailTransaksisScheduledForDeletion->search($l));
}
}
return $this;
}
示例6: addGastofacturacion
/**
* Method called to associate a Gastofacturacion object to this object
* through the Gastofacturacion foreign key attribute.
*
* @param Gastofacturacion $l Gastofacturacion
* @return Categoriagasto The current object (for fluent API support)
*/
public function addGastofacturacion(Gastofacturacion $l)
{
if ($this->collGastofacturacions === null) {
$this->initGastofacturacions();
$this->collGastofacturacionsPartial = true;
}
if (!in_array($l, $this->collGastofacturacions->getArrayCopy(), true)) {
// only add it if the **same** object is not already associated
$this->doAddGastofacturacion($l);
if ($this->gastofacturacionsScheduledForDeletion and $this->gastofacturacionsScheduledForDeletion->contains($l)) {
$this->gastofacturacionsScheduledForDeletion->remove($this->gastofacturacionsScheduledForDeletion->search($l));
}
}
return $this;
}
示例7: addLinkBarangRak
/**
* Method called to associate a LinkBarangRak object to this object
* through the LinkBarangRak foreign key attribute.
*
* @param LinkBarangRak $l LinkBarangRak
* @return Rak The current object (for fluent API support)
*/
public function addLinkBarangRak(LinkBarangRak $l)
{
if ($this->collLinkBarangRaks === null) {
$this->initLinkBarangRaks();
$this->collLinkBarangRaksPartial = true;
}
if (!in_array($l, $this->collLinkBarangRaks->getArrayCopy(), true)) {
// only add it if the **same** object is not already associated
$this->doAddLinkBarangRak($l);
if ($this->linkBarangRaksScheduledForDeletion and $this->linkBarangRaksScheduledForDeletion->contains($l)) {
$this->linkBarangRaksScheduledForDeletion->remove($this->linkBarangRaksScheduledForDeletion->search($l));
}
}
return $this;
}
示例8: addExpedientehistorial
/**
* Method called to associate a Expedientehistorial object to this object
* through the Expedientehistorial foreign key attribute.
*
* @param Expedientehistorial $l Expedientehistorial
* @return Servicioestado The current object (for fluent API support)
*/
public function addExpedientehistorial(Expedientehistorial $l)
{
if ($this->collExpedientehistorials === null) {
$this->initExpedientehistorials();
$this->collExpedientehistorialsPartial = true;
}
if (!in_array($l, $this->collExpedientehistorials->getArrayCopy(), true)) {
// only add it if the **same** object is not already associated
$this->doAddExpedientehistorial($l);
if ($this->expedientehistorialsScheduledForDeletion and $this->expedientehistorialsScheduledForDeletion->contains($l)) {
$this->expedientehistorialsScheduledForDeletion->remove($this->expedientehistorialsScheduledForDeletion->search($l));
}
}
return $this;
}
示例9: addMedicoespecialidad
/**
* Method called to associate a Medicoespecialidad object to this object
* through the Medicoespecialidad foreign key attribute.
*
* @param Medicoespecialidad $l Medicoespecialidad
* @return Especialidad The current object (for fluent API support)
*/
public function addMedicoespecialidad(Medicoespecialidad $l)
{
if ($this->collMedicoespecialidads === null) {
$this->initMedicoespecialidads();
$this->collMedicoespecialidadsPartial = true;
}
if (!in_array($l, $this->collMedicoespecialidads->getArrayCopy(), true)) {
// only add it if the **same** object is not already associated
$this->doAddMedicoespecialidad($l);
if ($this->medicoespecialidadsScheduledForDeletion and $this->medicoespecialidadsScheduledForDeletion->contains($l)) {
$this->medicoespecialidadsScheduledForDeletion->remove($this->medicoespecialidadsScheduledForDeletion->search($l));
}
}
return $this;
}
示例10: addCajachicadetalle
/**
* Method called to associate a Cajachicadetalle object to this object
* through the Cajachicadetalle foreign key attribute.
*
* @param Cajachicadetalle $l Cajachicadetalle
* @return Gasto The current object (for fluent API support)
*/
public function addCajachicadetalle(Cajachicadetalle $l)
{
if ($this->collCajachicadetalles === null) {
$this->initCajachicadetalles();
$this->collCajachicadetallesPartial = true;
}
if (!in_array($l, $this->collCajachicadetalles->getArrayCopy(), true)) {
// only add it if the **same** object is not already associated
$this->doAddCajachicadetalle($l);
if ($this->cajachicadetallesScheduledForDeletion and $this->cajachicadetallesScheduledForDeletion->contains($l)) {
$this->cajachicadetallesScheduledForDeletion->remove($this->cajachicadetallesScheduledForDeletion->search($l));
}
}
return $this;
}
示例11: addUser
/**
* Associate a User object to this object
* through the user_skill cross reference table.
*
* @param User $user The UserSkill object to relate
* @return Skill The current object (for fluent API support)
*/
public function addUser(User $user)
{
if ($this->collUsers === null) {
$this->initUsers();
}
if (!$this->collUsers->contains($user)) {
// only add it if the **same** object is not already associated
$this->doAddUser($user);
$this->collUsers[] = $user;
if ($this->usersScheduledForDeletion and $this->usersScheduledForDeletion->contains($user)) {
$this->usersScheduledForDeletion->remove($this->usersScheduledForDeletion->search($user));
}
}
return $this;
}
示例12: addSubscriberGroupMembership
/**
* Method called to associate a SubscriberGroupMembership object to this object
* through the SubscriberGroupMembership foreign key attribute.
*
* @param SubscriberGroupMembership $l SubscriberGroupMembership
* @return Subscriber The current object (for fluent API support)
*/
public function addSubscriberGroupMembership(SubscriberGroupMembership $l)
{
if ($this->collSubscriberGroupMemberships === null) {
$this->initSubscriberGroupMemberships();
$this->collSubscriberGroupMembershipsPartial = true;
}
if (!in_array($l, $this->collSubscriberGroupMemberships->getArrayCopy(), true)) {
// only add it if the **same** object is not already associated
$this->doAddSubscriberGroupMembership($l);
if ($this->subscriberGroupMembershipsScheduledForDeletion and $this->subscriberGroupMembershipsScheduledForDeletion->contains($l)) {
$this->subscriberGroupMembershipsScheduledForDeletion->remove($this->subscriberGroupMembershipsScheduledForDeletion->search($l));
}
}
return $this;
}
示例13: PropelObjectCollection
$nb_creneau_a_saisir = 0; //il faut calculer le nombre de creneau a saisir pour faire un colspan
if ($current_creneau != null && $current_creneau->getPrimaryKey() == $edt_creneau->getPrimaryKey()) {
$creneau_courant=$i;
$afficheEleve[$elv]['creneau_courant']=$i;
// on va faire une boucle pour calculer le nombre de creneaux dans ce cours
if ($current_cours == null) {
$nb_creneau_a_saisir = 1;
$absences_du_creneau = $eleve->getAbsenceEleveSaisiesDuCreneau($edt_creneau, $dt_date_absence_eleve);
} else {
//$nb_creneau_a_saisir = 0;
$dt_fin_cours = $current_cours->getHeureFin(null);
$it_creneau = $edt_creneau;
$absences_du_creneau = new PropelObjectCollection();
while ($it_creneau != null && $dt_fin_cours->format('U') > $it_creneau->getHeuredebutDefiniePeriode('U')) {
foreach ($eleve->getAbsenceEleveSaisiesDuCreneau($it_creneau, $dt_date_absence_eleve) as $abs) {
if (!$absences_du_creneau->contains($abs)) {
$absences_du_creneau->append($abs);
}
}
$it_creneau = $it_creneau->getNextEdtCreneau();
$nb_creneau_a_saisir++;
}
}
// pour le creneau en cours on garde uniquement les absences de l'utilisateur pour ne pas l'influencer par d'autres saisies sauf si configuré autrement
if (getSettingValue("abs2_afficher_saisies_creneau_courant")!='y') {
$absences_du_creneau_du_prof = new PropelObjectCollection();
foreach ($absences_du_creneau as $abs) {
if ($abs->getUtilisateurId() == $utilisateur->getPrimaryKey()) {
$absences_du_creneau_du_prof->append($abs);
}
}
示例14: addOrdencompra
/**
* Method called to associate a Ordencompra object to this object
* through the Ordencompra foreign key attribute.
*
* @param Ordencompra $l Ordencompra
* @return Proveedor The current object (for fluent API support)
*/
public function addOrdencompra(Ordencompra $l)
{
if ($this->collOrdencompras === null) {
$this->initOrdencompras();
$this->collOrdencomprasPartial = true;
}
if (!in_array($l, $this->collOrdencompras->getArrayCopy(), true)) {
// only add it if the **same** object is not already associated
$this->doAddOrdencompra($l);
if ($this->ordencomprasScheduledForDeletion and $this->ordencomprasScheduledForDeletion->contains($l)) {
$this->ordencomprasScheduledForDeletion->remove($this->ordencomprasScheduledForDeletion->search($l));
}
}
return $this;
}
示例15: addNestedSetChild
/**
* Adds an element to the internal $collNestedSetChildren collection.
* Beware that this doesn't insert a node in the tree.
* This method is only used to facilitate children hydration.
*
* @param Especialidad $especialidad
*
* @return void
*/
public function addNestedSetChild($especialidad)
{
if ($this->collNestedSetChildren === null) {
$this->initNestedSetChildren();
}
if (!$this->collNestedSetChildren->contains($especialidad)) {
// only add it if the **same** object is not already associated
$this->collNestedSetChildren[] = $especialidad;
$especialidad->setParent($this);
}
}